请问这段代码为什么总有两个测试点无法通过
查看原帖
请问这段代码为什么总有两个测试点无法通过
390229
MymyX楼主2020/11/14 17:05
#include<bits/stdc++.h>
#define S strchr
int b=0,g=0;
char B[]="boy",G[]="girl",c,s='.',*t;
int main(){
	while(~(c=getchar())){ 
		if(c!=46){
			(t=S(B,c)?S(B,c):S(G,c))--;
			if(s==46||*t!=s) (S(B,c)?b:g)++;
		}
		s=c; 
	}
	printf("%d\n%d",b,g);
	return 0;
}

2020/11/14 17:05
加载中...