Chat room
/*
Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.
Input
The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.
Output
If Vasya managed to say hello, print "YES", otherwise print "NO".
Example
ahhellllloou
YES
hlelo
NO */
#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std; char a[]; int main()
{
cin >> a;
getchar();
int k = ;
int i,j,n,m,v;
for(i = ; i <= strlen(a); i ++)
{
if(a[i] == 'h')
{
k ++;
int I=i;
i=strlen(a);
//cout << k << endl;
for(int j = (I+); j <= strlen(a); j++)
{
if(a[j] == 'e')
{
k++;
int J=j;
j=strlen(a);
for(int n = J+; n <= strlen(a); n++)
{
if(a[n] == 'l')
{
k++;
int N=n;
n=strlen(a);
//cout << k << endl;
for(int m = N+; m <= strlen(a); m++)
{
if(a[m] == 'l')
{
k++;
int M=m;
m=strlen(a);
//cout << k << endl;
for(int v = M+; v <= strlen(a); v++)
{
if(a[v] == 'o')
{
k++;
v=strlen(a);
}
}
}
}
}
}
}
}
}
}
if(k >= )
cout << "YES" <<endl;
else cout << "NO" <<endl;
//cout << k << endl;
return ;
}
Chat room的更多相关文章
- 三周,用长轮询实现Chat并迁移到Azure测试
公司的OA从零开始进行开发,继简单的单点登陆.角色与权限.消息中间件之后,轮到在线即时通信的模块需要我独立去完成.这三周除了逛网店见爱*看动漫接兼职,基本上都花在这上面了.简单地说就是用MVC4基于长 ...
- Socket programing(make a chat software) summary 1:How to accsess LAN from WAN
First we should know some basic conceptions about network: 1.Every PC is supposed to have its own IP ...
- Node聊天程序实例03:chat.js
作者:vousiu 出处:http://www.cnblogs.com/vousiu 本实例参考自Mike Cantelon等人的<Node.js in Action>一书. chat.j ...
- Fake chat script for website download
Are you searching for free fake webchat script then you are at the right place go get download your ...
- IRC(Internet Relay Chat Protocol) Protocal Learning && IRC Bot
catalogue . Abstract . INTRODUCTION . 通信协议Connection Registration Action . 通信协议Channel operations Ac ...
- HDU 5071 Chat(2014鞍山赛区现场赛B题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5071 解题报告:一个管理聊天窗口的程序,一共有八种操作,然后要注意的就是Top操作只是把编号为u的窗口 ...
- ocket.chat 使用 Meteor 开发的实时协作工具,类似 丁丁。
ocket.chat 使用 Meteor 开发的实时协作工具,类似 丁丁. https://rocket.chat/
- 局域网聊天Chat(马士兵视频改进版)
Github地址: https://github.com/BenDanChen/Chat Chat 小小的聊天系统,主要是跟着网上的马士兵老师的公开视频然后再自己反思有什么地方需要改进的地方,然后大体 ...
- Dig out deleted chat messages of App Skype
Last month Candy was arrested on suspicion of having doing online porn webcam shows, but Candy refus ...
- [CareerCup] 8.7 Chat Server 聊天服务器
8.7 Explain how you would design a chat server. In particular, provide details about the various bac ...
随机推荐
- HDFS中的集中缓存管理详解
一.背景 Hadoop设计之初借鉴GFS/MapReduce的思想:移动计算的成本远小于移动数据的成本.所以调度通常会尽可能将计算移动到拥有数据的节点上,在作业执行过程中,从HDFS角度看,计算和数据 ...
- FTP原理和虚拟用户映射登录-2019.2.8
FTP主动模式和被动模式 FTP(File Transfer Protocol)是文件传输协议的简称.正如其名所示:FTP的主要作用,就是让用户连接上一个远程计算机(这些计算机上运行着FTP服务器程序 ...
- python爬取酒店信息练习
爬取酒店信息,首先知道要用到那些库.本次使用request库区获取网页,使用bs4来解析网页,使用selenium来进行模拟浏览. 本次要爬取的美团网的蚌埠酒店信息及其评价.爬取的网址为“http:/ ...
- 使用ddns搭建免费服务器
[使用ddns搭建免费服务器] 第一步 tplink路由器提供了ddns服务,它为用户免费提供一个子tpddns.cn下的子域名,映射到你的路由器上.当启用后,只在要能接入互联网的地方,都能过此域名, ...
- spring 中 PO与DTO相互转换的工具类
public class BeanMapper { /** * 持有Dozer单例, 避免重复创建DozerMapper消耗资源. */ private static DozerBeanMapper ...
- spark streaming集成kafka接收数据的方式
spark streaming是以batch的方式来消费,strom是准实时一条一条的消费.当然也可以使用trident和tick的方式来实现batch消费(官方叫做mini batch).效率嘛,有 ...
- 无法加载DLL"***.dll":找不到指定的模块
加载dll的路径不对. 绝对路径不合适,可以换成相对路径. 比如: 把dll放入bin目录下的debug或者release下,然后就可以直接“test.dll”了.不用加路径了. 注意:路径必须与发布 ...
- 使用iptables禁止外网访问tomcat的8080端口
如果项目同时使用了nginx反向代理服务器和tomcat等web服务器,并且两台服务器都暴露于公网中,那么通常我们会禁止外网直接访问tomcat,因为以下原因: 1.如果可以直接访问tomcat,那么 ...
- pta7-7旅游规划(dijkstra算法)
题目链接:https://pintia.cn/problem-sets/1101307589335527424/problems/1101314114762387456 题意:给n给城市,m条公路,公 ...
- NumPy IO
NumPy IO Numpy 可以读写磁盘上的文本数据或二进制数据. NumPy 为 ndarray 对象引入了一个简单的文件格式:npy. npy 文件用于存储重建 ndarray 所需的数据.图形 ...