Problem from code coach.
https://www.sololearn.com/coach/55?ref=app. my solution in C++ is below (it's not working) : #include<string> #include<iostream> using namespace std; bool is_letter(char a) { int b; b = (int)a;/*converts char to int(ASCII value)*/ if(b==32)/* 32 is the ASCII value of space */ { return true; } if((b>=65||b<=90)||(b>=97||b<=122)) /*letters 'A' to 'Z' & 'a' to 'z' respectively */ { return true; } return false; }; int main() { string message,hidden; getline(cin,message); int length = message.size(); int i,j=0; for(i=(length-1);i>=0;i--) { if(is_letter(message[i])) { hidden[j]=message[i]; j++; } } cout<<hidden<<endl; return 0; }