CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <sstream>
using namespace std;
int main() {
string msg, word;
string wd = "";
getline(cin, msg);
stringstream ss(msg);
while(ss>>word){
int len=word.length();
for(int i=1;i<len;i++){
wd = wd + word[i];
}
wd = wd + word[0] + "ay";
cout << wd << " ";
wd = "";
}
return 0;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run