只能过4个点 求指教

P1042 [NOIP2003 普及组] 乒乓球

本蒟蒻代码,参考一下: ```cpp #include<bits/stdc++.h> using namespace std; char a; string s; int t; int k; int w,l; int len; int main() { while(cin>>a&&a!='E') { if(a=='W') { w++; s+=a; } if(a=='L') { l++; s+=a; } if((w>=11||l>=11)&&(w-l>=2||l-w>=2)) { cout<<w<<':'<<l<<endl; w=0; l=0; } len++; } cout<<w<<':'<<l<<endl<<endl; w=0,l=0; for(int i=0;i<len;i++) { if(s[i]=='W') w++; if(s[i]=='L') l++; if((w>=21||l>=21)&&(w-l>=2||l-w>=2)) { cout<<w<<':'<<l<<endl; w=0; l=0; } } cout<<w<<':'<<l; return 0; } ```
by 张亦弛 @ 2018-10-30 10:38:25


@[张亦弛](/space/show?uid=59097) 大佬,能否说一下我哪里错了,谢谢大佬的代码
by 蒟蒻Tsing @ 2018-10-30 10:44:24


@[张亦弛](/space/show?uid=59097) 11分制是任意一个人达到11分??? 我刚才看数据也是这样...
by 蒟蒻Tsing @ 2018-10-30 10:46:14


@[张亦弛](/space/show?uid=59097) 谢谢大佬,我感觉我好像明白了。。。这题目有坑
by 蒟蒻Tsing @ 2018-10-30 10:49:53


@[蒟蒻Tsing](/space/show?uid=134325) 不谢。。其实是一道常识题。。
by 张亦弛 @ 2018-10-30 10:50:48


@[蒟蒻Tsing](/space/show?uid=134325) 我没有看懂他的程序,但看到你的话之后,我~~多通过了一个点~~
by lion0514 @ 2018-11-18 11:17:56


@[I_am_gone__________](/space/show?uid=81708) QAQ 这条我会做了,是我当时理解错了,没高兴继续写...
by 蒟蒻Tsing @ 2018-11-18 14:11:43


|