首页 > 代码库 > hdu4847Wow! Such Doge!
hdu4847Wow! Such Doge!
题目链接: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!
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。