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.
21 lines
494 B
21 lines
494 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++;
|
|
}
|
|
cout<<boy<<endl<<girl<<endl;
|
|
return 0;
|
|
} |