For this Question: Find the logic of transformation that converts the following i/p to o/p and program it. 

Abbreviation meaning:
i/p - Input
o/p - Output

 	 	 									
i/p: But, why?
o/p: But,? yhw

i/p: My Rhythms fly
o/p: My smhtyhR fly

i/p: Hi, my name is ted. I am fine
o/p: Hi, ym name si ted. I am enif

i/p: peace out
o/p: peace tuoThe input contains a single string S.

Constraints:-
1 <= |S| <= 100000Print the output by figuring out the logicSample Input:-
newton school

Sample Output:-
newton loohcs

Sample input:-
My Rhythms fly

Sample Output:-
My smhtyhR fly, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int main(){
    int i=0;
    string s;
    while(cin>>s){
        if(i&1){
            reverse(s.begin(),s.end());
        }
        cout<<s<<" ";
        i++;
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?