View Code of Problem 114

#include <sstream>
#include <string>
#include <cstdio>
#include <iostream>

using namespace std;

int main(){
	string ss;
	while(getline(cin,ss)){
		stringstream str(ss);
		string word;
		while(str>>word){
			int len=word.length();
			for(int i=len-1;i>=0;i--){
				cout<<word[i]; 
			}
			cout<<" ";
		}
		cout<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 114