这是第一题:https://www.luogu.org/problemnew/show/P1042
首先,在做题之前要注意两个地方:
‘E’不一定出现在文本的末尾,也不一定出现在某行的末尾
比赛必须要领先2个球才能获胜,11:10的比分是不存在的
好了,废话不多说,直接上代码~~~
#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxN=100100;
string s[maxN];
int a[maxN],b[maxN],a2[maxN],b2[maxN];
int n=1,t=1,t2=1;
bool check(int x)
{
int t=s[x].size();
for(int i=0;i<t;i++)
if(s[x][i]=='E')return 0;
return 1;
}
int main()
{
freopen("table.in","r",stdin);
freopen("yable.out","w",stdout);
cin>>s[n];
while(check(n)){
n++;
cin>>s[n];
}
for(