Wow! Such Doge! - HDU 4847 (水题)

时间:2022-04-25 04:52:20
题目大意:题目描述了一大堆.....然而并没什么用,其实就是让求给的所有字符串里面有多少个"doge",不区分大小写。
 
代码如下:
======================================================================================================================
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std; const int MAXN = 1e6+;
const int oo = 1e9+; char s[MAXN]; int main()
{
int ans = ; while(scanf("%s", s) != EOF)
{
for(int i=; s[i]; i++)
{
if(s[i] >= 'A' && s[i] <= 'Z')
s[i] = s[i] - 'A' + 'a';
} char *p = s; while(p=strstr(p, "doge"), p != NULL)
ans++, p+=;
} printf("%d\n", ans); return ;
}