求助,问下大佬该怎么改啊
查看原帖
求助,问下大佬该怎么改啊
1617657
plmnbvcxz4楼主2024/12/16 15:28
using namespace std;  
using ll=long long;  
const int N=1e5+10;  
char a[N];  
void regulation(int mscore){  
  int x=0,y=0;  
  int i;  
  for( i=1;a[i]!='E';i++){  
    if(a[i]=='W')x++;  
    if(a[i]=='L')y++;  
    if(i%mscore==0){  
      cout<<x<<':'<<y<<'\n';  
      x=0;y=0; 
   }  
  }  
  if(x!=0||y!=0)  
  cout<<x<<':'<<y<<'\n';  
}  
int main(){  
  int i;  
  for(i=1;cin>>a[i]&&a[i]!='E';i++){  
  if(a[i]=='\n')  
  continue;  
  }  
  regulation(11);  
  cout<<'\n';  
  regulation(21);  
  return 0;  
}  ```
2024/12/16 15:28
加载中...