HDU-4847 Wow! Such Doge!,模拟!
2017-04-01 08:50
260 查看
Wow! Such Doge!
题意:给定的字符串中doge出现了多少次,直接模拟即可,不用KMP。char s ; int main() { // int n; int ans=0; while(gets(s)) { for(int i=0; s[i]!='\0'; i++) if(s[i]>='A'&&s[i]<'z') { if(s[i]=='d'||s[i]=='D') { if(s[i+1]=='o'||s[i+1]=='O') { if(s[i+2]=='g'||s[i+2]=='G') { if(s[i+3]=='e'||s[i+3]=='E') { ans++; i+=3; } } } } } } printf("%d\n",ans); return 0; }
对于最后没有结果出来,Ctrl+Z即可。
相关文章推荐
- HDU 4847 Wow! Such Doge!(模拟)
- hdu 4847 Wow! Such Doge! 水题
- HDU 4847-Wow! Such Doge!(定位)
- hdu 4847 Wow! Such Doge!
- HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
- HDU 4847 Wow! Such Doge!【简单题】
- HDU-4847:Wow! Such Doge!(震惊!!!kmp模板题。。。kmp:我不要面子的啊)
- HDU 4847 Wow! Such Doge!
- HDU-4847 Wow! Such Doge!
- 简单题(需要注意一个细节) 之 hdu 4847 Wow! Such Doge!
- Wow! Such Doge! - HDU 4847 (水题)
- HDU 4847 Wow! Such Doge!
- HDU 4847 Wow! Such Doge! (注意输入格式!)
- hdu 4847 Wow! Such Doge!
- hdu 4847 Wow! Such Doge!(水题)
- HDU-4847-Wow! Such Doge!
- HDU 4847-Wow! Such Doge!(签到)
- HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
- 简单题(需要注意一个细节) 之 hdu 4847 Wow! Such Doge!
- hdoj-4847 Wow! Such Doge!