十只WA,咋搞?
查看原帖
十只WA,咋搞?
373959
AFwhcing楼主2020/10/4 11:41

源代码:

#include<bits/stdc++.h>
using namespace std;
const int MAXN=25*2500;
char a[MAXN];
int ew,el,tow,tol;//eleven_win,eleven_lose,twenty_one_win,twenty_one_lose
int main(){
    scanf("%s",a);
    for(int i=0;a[i]!='e';++i){
        if(i%11==0) ew=0,el=0;
        if(a[i]=='w')   ++ew;
        else ++el;
        if(ew==11||el==11) {printf("%d:%d\n",ew,el);continue;}
        if(a[i+1]=='e') printf("%d:%d\n",ew,el);break;
    }
    putchar('\n');
    for(int i=0;a[i]!='e';++i){
        if(i%21==0) tow=0,tol=0;
        if(a[i]=='w')   ++tow;
        else ++tol;
        if(tow==21||tol==21) {printf("%d:%d\n",tow,tol);continue;}
        if(a[i+1]=='e') printf("%d:%d\n",tow,tol);break;
    }
    return 0;
}

啧啧啧,真TM烦

2020/10/4 11:41
加载中...