求大佬帮帮 50分代码但是不知道哪出问题

P1042 [NOIP2003 普及组] 乒乓球

``` #include<bits/stdc++.h> using namespace std; char c[70000]; int main(){ int x=0,y=0; int i=1; while(true){ cin>>c[i]; if(c[i]=='W'){ x++; } if(c[i]=='L'){ y++; } if((x>=11||y>=11)&&abs(x-y)>=2||c[i]=='E'){ cout<<x<<":"<<y<<"\n"; if(c[i]=='E')break; x=0; y=0; } i++; } cout<<"\n"; c[i+1]='E'; i=1; x=0,y=0; while(true){ if(c[i]=='W'){ x++; } if(c[i]=='L'){ y++; } if((x>=21||y>=21)&&abs(x-y)>=2||c[i]=='E'){ cout<<x<<":"<<y<<"\n"; if(c[i]=='E')break; x=0; y=0; } i++; } return 0; } ``` @[zq1one](/user/1084455)
by chenbingjie @ 2024-03-30 07:32:26


|