You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
605 B
23 lines
605 B
#include<bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
int boy, girl;//存放答案滴
|
|
string x;
|
|
|
|
//这道题太无聊了~
|
|
int main() {
|
|
cin >> x;
|
|
for (int i = 0; i < x.length(); i++) {
|
|
//boy
|
|
if (x[i] == 'b')boy++;
|
|
if (x[i] == 'o' && x[i - 1] != 'b')boy++;
|
|
if (x[i] == 'y' && x[i - 1] != 'o')boy++;
|
|
//girl
|
|
if (x[i] == 'g')girl++;
|
|
if (x[i] == 'i' && x[i - 1] != 'g')girl++;
|
|
if (x[i] == 'r' && x[i - 1] != 'i')girl++;
|
|
if (x[i] == 'l' && x[i - 1] != 'r')girl++;
|
|
}
|
|
printf("%d\n%d", boy, girl);
|
|
return 0;
|
|
} |