求助!只对了一个点,求高人指点!

P1042 [NOIP2003 普及组] 乒乓球

这………… 没输出!
by Snoozing_QwQ @ 2021-09-04 19:48:18


哪没输出了?
by 最靓的哥 @ 2021-09-05 10:45:07


@[最靓的哥](/user/533436) ```cpp #include <iostream> #include <cstring> using namespace std; int main(){ int x=0,cnt=0; char t,a[62521]; while(1){ cin>>t; if(t=='E')break; if(t=='W'||t=='L')a[x++]=t; } int n=0,m=0,l=strlen(a); for(int i=0;i<l;i++){ cnt++; if(a[i]=='W')n++; if(a[i]=='L')m++; if(max(n,m)>=11&&(n-m>=2||m-n>=2)){ cout<<n<<":"<<m<<endl; n=0;m=0; cnt=0; } } /*if(n>0||m>0)*/cout<<n<<":"<<m<<endl; cout<<endl; cnt=0;m=0;n=0; for(int i=0;i<l;i++){ cnt++; if(a[i]=='W')n++; if(a[i]=='L')m++; if(max(n,m)>=21&&(n-m>=2||m-n>=2)){ cout<<n<<":"<<m<<endl; n=0;m=0; cnt=0; } } /*if(n>0||m>0)*/cout<<n<<":"<<m<<endl; cout<<endl; return 0; }
by Cstdio_Rabbit @ 2021-09-05 14:50:17


要输出未完成的比赛(0:0也要输出)
by liyuanchen2021 @ 2021-10-06 14:02:29


|