delete pics to save space
This commit is contained in:
31
1.1321.cpp
Normal file
31
1.1321.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include<cstdio>
|
||||
#include<algorithm>
|
||||
using namespace std;
|
||||
int boy,girl;
|
||||
char lst,now,shb[128];
|
||||
int main()
|
||||
{
|
||||
#ifdef local
|
||||
freopen("pro.in","r",stdin);
|
||||
#endif
|
||||
lst='.';
|
||||
shb['.']='.';
|
||||
shb['b']='o';
|
||||
shb['o']='y';
|
||||
shb['g']='i';
|
||||
shb['i']='r';
|
||||
shb['r']='l';
|
||||
while(now=getchar(),now!=EOF&&now!='\n'&&now!='\r')
|
||||
{
|
||||
// printf("read %c expect %c\n",now,shb[lst]);
|
||||
// if(now=='.') goto nxt;
|
||||
if((shb[lst]!=now&&lst!='y'&&lst!='l')||((lst=='y'||lst=='l')&&now!='.'))
|
||||
{
|
||||
if(now=='b'||now=='o'||now=='y') boy++;
|
||||
else girl++;
|
||||
}
|
||||
nxt: lst=now;
|
||||
}
|
||||
printf("%d\n%d\n",boy,girl);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user