View Code of Problem 52

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

using namespace std;

int main(){
	string str;
	getline(cin,str);
	int len=str.length();
	for(int i=0,j=len-1;i<j;++i,--j){
		int temp=str[i];
		str[i]=str[j];
		str[j]=temp;
	}
	cout<<str<<endl;
}

Double click to view unformatted code.


Back to problem 52