2,3,4,5,9,10都wa了,救救孩子!

P1042 [NOIP2003 普及组] 乒乓球

28行的if应该变成else if 而且在存的时候一个是1另一个应该是0 实在不懂可以看看我的: ```cpp #include<bits/stdc++.h> using namespace std; string s1,s; int i,n,m,w,l; bool flag; int main(){ for(i=1;i<=8000;i++){ cin>>s1; s=s+s1; if(s1.find('E')!=-1)break; }for(i=0;i<s.size();i++){ flag=false; if(s[i]=='W')w++; else if(s[i]=='L')l++; else break; if(w>=11||l>=11){ if(w-l>=2||l-w>=2){ cout<<w<<':'<<l<<endl; w=0; l=0; flag=true; } } }if(flag==false)cout<<w<<':'<<l<<endl; w=0; l=0; cout<<endl; for(i=0;i<s.size();i++){ flag=false; if(s[i]=='W')w++; else if(s[i]=='L')l++; else break; if(w>=21||l>=21){ if(w-l>=2||l-w>=2){ cout<<w<<':'<<l<<endl; w=0; l=0; flag=true; } } }if(flag==false)cout<<w<<':'<<l<<endl; return 0; }
by William_wyx @ 2022-06-09 14:28:32


@[oyeoye](/user/691036) 你明白我的意思吗?
by William_wyx @ 2022-06-09 14:51:49


谢谢
by oyeoye @ 2022-06-09 15:56:48


|