- 乒乓球
- 2018-07-22 21:20:39 @
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
string c;
int a,b;
int main(){
cin>>c;
for(int i=0;i<=c.length();i++) {
if(c[i]=='W') a++;
else if(c[i]=='L') b++;
else if(c[i]=='E') break;
else if(c[i]==' ') continue;
if((a>=11||b>=11)&&abs(a-b)>=2){
cout<<a<<":"<<b<<endl;
a=0;
b=0;
}
}
if(a!=0||b!=0)
cout<<a<<":"<<b<<endl;
if(a==0&&b==0)
cout<<"0:0";
a=0; b=0;
cout<<endl;
for(int i=0;i<=c.length();i++) {
if(c[i]=='W') a++;
else if(c[i]=='L') b++;
else if(c[i]=='E') break;
else if(c[i]==' ') continue;
if((a>=21||b>=21)&&abs(a-b)>=2){
cout<<a<<":"<<b<<endl;
a=0;
b=0;
}
}
if(a!=0||b!=0)
cout<<a<<":"<<b<<endl;
if(a==0&&b==0)
cout<<"0:0";
}
2 条评论
-
QAQAQAQAQAQ LV 7 @ 2018-07-22 21:22:37
?
-
2018-07-22 21:22:14@
emmmmmmmmmmmmmmmmmmmmmm
- 1