求救!!!
查看原帖
求救!!!
1671679
blm0419楼主2025/6/15 17:19

当前情况:RE

#include<bits/stdc++.h>
using namespace std;
int is[25*2510]={0};
void read(){
    string s;
    int i=0;
    while(cin>>s){
        int j=i;
        for(;i<s.length()+j;i++){
            if(s[i]=='W') is[i]=1;
            else if(s[i]=='E'){
                is[i]=2;
                return ;   
            }
        }
    }    
}
void processing11(){//处理的意思
    int w=0,l=0;
    for(int i=0;;i++){
        if(is[i]==1) w++;
        else if(is[i]==0) l++;
        else{
            printf("%i:%i\n\n",w,l);
            return ;
        }
        if((w>=11||l>=11)&&(abs(w-l)>=2)){
            printf("%i:%i\n",w,l);
            w=0;l=0;
        }
    }
}
void processing21(){//处理的意思
    int w=0,l=0;
    for(int i=0;;i++){
        if(is[i]==1) w++;
        else if(is[i]==0) l++;
        else{
            printf("%i:%i\n\n",w,l);
            return ;
        }
        if((w>=21||l>=21)&&(abs(w-l)>=2)){
            printf("%i:%i\n",w,l);
            w=0;l=0;
        }
    }
}
int main(){ 
    read();
    processing11();
    processing21();
	return 0;
}
2025/6/15 17:19
加载中...