- 乒乓球
- 2017-12-29 19:30:09 @
#include<iostream>
using namespace std;
#include<math.h>
int main()
{
char record;
int sum1[70000] = { 0 };
int sum2[70000] = { 0 };
int sum3[50000] = { 0 };
int sum4[50000] = { 0 };
int n = 0; int m = 0;
while (cin >> record)
{
if (record == 'E') break;
if ((sum1[n] >= 11 || sum2[n] >= 11) && abs(sum1[n]-sum2[n])>=2) n++;
if ((sum3[m] >= 21 || sum4[m] >= 21) && abs(sum3[m] - sum4[m])>=2) m++;
if (record == 'W') { sum1[n]++; sum3[m]++; }
if (record == 'L') { sum2[n]++; sum4[m]++; }
}
for (int i = 0; i <= n; i++)
cout << sum1[i] << ":" << sum2[i] << endl;
cout << endl;
for (int i = 0; i <= m; i++)
cout << sum3[i] << ":" << sum4[i] << endl;
return 0;
}
2 条评论
-
fys1997 LV 6 @ 2018-02-02 18:02:32
最后一个也是ac不了了,你解决了吗
-
2018-01-29 12:14:53@
差点以为是题库里就剩一个没有AC
- 1