CC
Size: a a a
CC
CC
Б
Б
Б
Б
n
c
J
J
Б
EE
EE
#include <sstream>
std::string pig_it(std::string str)
{
// Code here
std::istringstream s(str);
std::string buf;
std::string ay("ay");
std::string result="";
while (getline(s,buf,' '))
{
if(buf.size()<2)
{
result+=(buf + " ");
continue;
}
char c = *buf.begin();
buf.erase(buf.begin());
buf.push_back(c);
buf+=ay;
result+=(buf + " ");
}
result.pop_back();
return result;
}
EE
EE
EE
J
Μ
Μ