View Code of Problem 3496

#include<bits/stdc++.h>
using namespace std;
//3496 
//13 19 23 28 36 60 61 62 96 97 99 104 108 120
// 没看明白18
//66高精度88背包问题动态规划
int main()
{
	
	string str1;
	string str2;
	while (getline(cin,str1))
	{
		str2 = "";
		for (int i(0); i < str1.length(); ++i)
		{
			if (i < str1.length() - 2 && str1[i] == 'y' && str1[i + 1] == 'o' && str1[i + 2] == 'u')
			{
				str2 += "we";
				i += 2;
			}
			else
			{
				str2 += str1[i];
			}
		}
		cout << str2 << endl;
	}
	return 0;
}
/*
Main.cc:2:24: bits/stdc++.h: No such file or directory
Main.cc: In function `int main()':
Main.cc:11: error: `string' undeclared (first use this function)
Main.cc:11: error: (Each undeclared identifier is reported only once for each function it appears in.)
Main.cc:11: error: expected `;' before "str1"
Main.cc:12: error: expected `;' before "str2"
Main.cc:13: error: `cin' undeclared (first use this function)
Main.cc:13: error: `str1' undeclared (first use this function)
Main.cc:13: error: `getline' undeclared (first use this function)
Main.cc:15: error: `str2' undeclared (first use this function)
Main.cc:28: error: `cout' undeclared (first use this function)
Main.cc:28: error: `endl' undeclared (first use this function)
*/

Double click to view unformatted code.


Back to problem 3496