- 取石子
还原歌词gzjun/题解/
- 2025-7-15 15:06:24 @
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int x=0;
for(int i=0;i<s.size();i++){
if(int(s.find("WUB",x))!=-1){
x=s.find("WUB",x);
s.replace(x,3," ");
}
}
for(int i=0;i<s.size();i++){
if(s[i]==' '&&s[i+1]==' '){
s.erase(i,1);
i--;
}
}
if(s[0]==' '){
s.replace(0,1,"");
}
cout<<s;
return 0;
}
0 条评论
目前还没有评论...
信息
- ID
- 116
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 56
- 已通过
- 9
- 上传者