#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
int boy, girl, n; //自动初始化
int main()
{
char a[100000];
scanf("%s", a);
int n = strlen(a);
for(int i = 0; i < n-2; i++)
boy += (a[i] == 'b' || a[i+1] == 'o' || a[i+2] == 'y');
for(int i = 0; i < n-3; i++)
girl += (a[i] == 'g' || a[i+1] == 'i' || a[i+2] == 'r' || a[i+3] == 'l');
printf("%d\n%d", boy, girl);
return 0;
}
P1321 单词覆盖还原
最新推荐文章于 2024-06-06 17:22:20 发布