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 }
时间: 2024-08-24 00:53:16

hdu4847Wow! Such Doge!的相关文章

HDU-4847-Wow! Such Doge!

Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 808    Accepted Submission(s): 509 Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme

(KMP 水)Wow! Such Doge! -- hdu -- 4847

http://acm.hdu.edu.cn/showproblem.php?pid=4847 Wow! Such Doge! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4847 Description Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Inter

(KMP 水)Wow! Such Doge! -- hdu

http://acm.hdu.edu.cn/showproblem.php?pid=4847 Wow! Such Doge! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4847 Description Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Inter

HDU 4847-Wow! Such Doge!(签到)

Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 693    Accepted Submission(s): 447 Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme

hdu4847:Wow! Such Doge!(字符串匹配)

题目:hdu4847:Wow! Such Doge! 题目大意:在给出的段落里面找出"doge"出现的次数,大小写都可以. 解题思路:字符串匹配问题,可以在之前将字母都转换成统一格式. 代码: #include <stdio.h> #include <string.h> const int N = 1e6; char str[N]; const char *s1 = "doge"; int find () { int sum = 0; cha

Wow! Such Doge!---hdu4847(字符串水题)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 题意就是求给出的文章中共有多少个doge,不区分大小写直接用strstr做就可以了: #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; const int N = 1100; int main() { int ans=0; char s[N]; while(get

HDU 4847-Wow! Such Doge!(定位)

Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 693    Accepted Submission(s): 447 Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme

hdu 4847 Wow! Such Doge! 水题

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 统计文本中一共有多少个“Doge” 水题 #include <cstring> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <iostream> #include <cstdio> #includ

hdu4847 Wow! Such Doge!(此题简单+坑爹的输入)

转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme. Wow.". Gawker. Retrieved November 22, 2