#include<bits/stdc++.h>
using namespace std;
typedef struct M {
int m, y;
} M;
M a[10001], b[10001];
char f;
int win1, lose1, win2, lose2, r1, r2;
int main() {
while (1) {
cin >> f;
if (f == 'E') {
for (int i = 1; i <= r1; i++) {
cout << a[i].m << ":" << a[i].y << endl;
}
//if(win1!=0||lose1!=0)
cout << win1 << ":" << lose1 << endl;
cout << endl;
int fd = 0;
for (int i = 1; i <= r2; i++) {
cout << b[i].m << ":" << b[i].y << endl;
fd += b[i].m + b[i].y;
}
// if(win2!=0||lose2!=0)
cout << win2 << ":" << lose2 << endl;
return 0;
}
if (f == 'W') {
win1++ ;
win2++;
if (win1 >= 11&&abs(win1 - lose1) >= 2) {
r1++;
a[r1].m = win1;
a[r1].y = lose1;
win1 = 0;
lose1 = 0;
}
if (win2 >= 21 && abs(win2 - lose2) >= 2) {
r2++;
b[r2].m = win2;
b[r2].y = lose2;
lose2 = 0;
win2 = 0;
}
} else {
lose1++;
lose2++;
if (lose1 >= 11&&abs(win1 - lose1) >= 2) {
r1++;
a[r1].m = win1;
a[r1].y = lose1;
win1 = 0;
lose1 = 0;
}
if (lose2 >= 21 && abs(win2 - lose2) >= 2) {
r2++;
b[r2].m = win2;
b[r2].y = lose2;
lose2 = 0;
win2 = 0;
}
}
}
}
中间有两个if语句被注释了,我这两个语句意思是:如果我最后的比赛正好是完整的(双方比分0:0)我就不输出了。 可是加上了,就只有80分;不加,AC。 我:???