View Code of Problem 114

#include <bits/stdc++.h>
using namespace std;

int main()
{
	string s;
	int first=0;
	while(cin>>s)
	{
		if(s=="")
		break;
		reverse(s.begin(),s.end());
		if(first==0)
		{
			first=1;
			cout<<s;
		}
		else
		{
			cout<<" "<<s;
		}
		
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 114