View Code of Problem 114

#include<bits/stdc++.h>
using namespace std;
int main(){
	string ss;
	while(getline(cin,ss)){
		string pp="";
		for(int i=0;i<ss.size();i++){
			if(isalpha(ss[i]))
			{
				pp=ss[i]+pp;
			}
			else
			{
				cout<<pp<<ss[i];
				pp.clear();
			}
		}
		cout<<pp<<endl;
		
	}
}

Double click to view unformatted code.


Back to problem 114