HDu4847
来源:互联网 发布:淘宝图库 编辑:程序博客网 时间:2024/06/03 18:38
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char a[10001];
int ans=0,k;
while(gets(a)!=EOF)
{
k=strlen(a);
for(int i=1; i<=k; i++)
{
if(a[i]>='A'&&a[i]<='Z')
a[i]+=32;
}
for(int i=1; i<=k; i++)
{
if(a[i]=='d'&&a[i+1]=='o'&&a[i+2]=='g'&&a[i+3]=='e')
ans++;
}
}
cout<<ans<<endl;
}
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char a[10001];
int ans=0,k;
while(gets(a)!=EOF)
{
k=strlen(a);
for(int i=1; i<=k; i++)
{
if(a[i]>='A'&&a[i]<='Z')
a[i]+=32;
}
for(int i=1; i<=k; i++)
{
if(a[i]=='d'&&a[i+1]=='o'&&a[i+2]=='g'&&a[i+3]=='e')
ans++;
}
}
cout<<ans<<endl;
}
0 0
- HDu4847
- hdu4847 水题
- HDU4847 Wow! Such Doge!
- HDU4847-Wow! Such Doge!
- hdu4847:Wow! Such Doge!(字符串匹配)
- 2014西安邀请赛 (hdu4847-4856)
- HDU4847-Wow! Such Doge!简单模拟
- hdu4847 Wow! Such Doge!(简单题+坑爹的输入)
- 黑帽SEO中的蜘蛛池是什么?
- 347. Top K Frequent Elements
- 停止线程
- open glHelloWorld之旋转的三角形(android)
- ios 开发学习日志 自定义alertView 1
- HDu4847
- 三级菜单制作
- poj 2387 Til the Cows Come Home -- 最短路dijstra
- yum 安装php,mysql,php-fpm,nginx
- linux 下的磁盘分区,格式化及其挂载
- Linux中线程与CPU核的绑定
- html5图形组合
- IBM Watson物联网平台的两个MQTT工具
- IC卡和ID卡的区别以及相同之处各是什么?