码迷,mamicode.com
首页 > 其他好文 > 详细

hdu4847Wow! Such Doge!

时间:2017-03-25 00:42:45      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:targe   oge   scanf   printf   pre   str   amp   print   http   

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847

水。

 1 #include<cstdio>
 2 #include<cstring>
 3 #include<cctype>
 4 char s[1010];
 5 
 6 int main()
 7 {
 8     int cnt=0;
 9     while(scanf("%s",s)!=EOF)
10     {
11         int n=strlen(s);
12         for(int i=0;i<n;i++)
13             if(isalpha(s[i]))  s[i]=tolower(s[i]);
14        for(int i=0;i+3<n;i++)
15             if(s[i]==d&&s[i+1]==o&&s[i+2]==g&&s[i+3]==e) cnt++;
16     }
17     printf("%d\n",cnt);
18 
19 }

 

hdu4847Wow! Such Doge!

标签:targe   oge   scanf   printf   pre   str   amp   print   http   

原文地址:http://www.cnblogs.com/yijiull/p/6614064.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!