您的位置:首页 > 其它

Codeforces Round #130 (Div. 2) A. Dubstep(STL做法)

2015-08-10 00:22 381 查看
找到所有的WUB

直接用空格代替即可

用string很方便

#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <string>
#include <numeric>
#include <algorithm>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <complex>
#include <ctime>

/*
int gcd(int a,int b)
{
return ! b ? a : gcd(b,a % b);
}
bool cmp(const data &a,const data &b)
{
if(a.val == b.val)
return a.pos < b.pos;
return a.val < b.val;
}
*/
typedef long long LL;

const double pi = acos(-1.0);
const long long mod = 1e9 + 7;

using namespace std;

string s;
int main()
{
//freopen("int.txt","r",stdin);
//freopen("out.txt","w",stdout);
cin >> s;
int a = s.find("WUB");
while(a != -1)
{
s.replace(a,3," ");
a = s.find("WUB");
}
cout << s << endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: