@[liuyishuo1234](/user/936629)
by zhangjiasheng1234 @ 2023-08-22 15:32:22
@[liuyishuo](/user/1061350)
by zhangjiasheng1234 @ 2023-08-22 15:32:43
可能是判的松一点
by liuyishuo @ 2023-08-22 15:35:00
@[zhangjiasheng1234](/user/939542)
洛谷IDE上测试上过的。
by 编码落寞 @ 2023-08-22 15:38:57
```
#include<bits/stdc++.h>
using namespace std;
int main() {
long long a=0,b=0,i;
char n,f='E';
string s;
//11分制
while(cin>>n &&n!='E') {
s+=n;
i++;}
s+=f;
for(int i=0;i>-1;i++){
if(s[i]=='W') a++;
if(s[i]=='L') b++;
if(s[i]=='E'){
cout<<a<<":"<<b<<endl<<endl;
a=0;
b=0;
break;
}
if((a>=11||b>=11)&&(a-b>=2||b-a>=2)) {
cout<<a<<":"<<b<<endl;
a=0;
b=0;
}
}
//21分制
a=0;
b=0;
for(int j=0; j<=i; j++) {
if(s[j]=='W') {
a++;
}
if(s[j]=='L') {
b++;
}
if(s[j]=='E'){
cout<<a<<":"<<b<<endl;
a=0;
b=0;
break;
}
if((a>=21||b>=21)&&(a-b>=2||b-a>=2)) {
cout<<a<<":"<<b<<endl;
a=0;
b=0;
}
}
}
这样就对了
by IKUN_LMX @ 2023-08-22 15:44:18