0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2025-01-26 09:40:06 +00:00
OI-codes/Luogu/P1321/P1321.cpp

24 lines
468 B
C++
Raw Normal View History

2020-09-20 17:27:35 +08:00
// R38664427
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
2021-11-19 17:01:13 +08:00
int boy, girl;
2020-09-20 17:27:35 +08:00
boy = girl = 0;
cin >> s;
for (int i = 0; i < s.size() - 2; i++) {
boy += (s[i] == 'b' || s[i + 1] == 'o' || s[i + 2] == 'y');
}
for (int i = 0; i < s.size() - 3; i++) {
girl += (s[i] == 'g' || s[i + 1] == 'i' || s[i + 2] == 'r' || s[i + 3] == 'l');
}
2021-11-19 17:01:13 +08:00
cout << boy << endl
<< girl << endl;
2020-09-20 17:27:35 +08:00
return 0;
}