View Code of Problem 121

#include "stdlib.h"
#include "algorithm"
#include "iostream"
#include <cstdio>
#include "string"
#include <iomanip>
#include <map>
#include <set>
#include "math.h"
using namespace std;
map<int, bool> mp;
set<string> st;

int main()
{
	string str; string str1 = "OH-OH-OH-QQ-PEI-PEI-SHION"; string str2 = "occupation";
	while (getline(cin, str))
	{
		int pos = str.find(str2);
		str.replace(pos,str2.length(),str1);
		cout << str<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 121