View Code of Problem 52

#include<iostream>
#include<string>
using namespace std;
int main() {
	string str;
	getline(cin, str);
	int size = str.size();
	char temp;
	for (int i = 0; i <size/2; i++)
	{
		temp = str[i];
		str[i] = str[size - i-1];
		str[size - i-1] = temp;
	}
	cout << str;
}

Double click to view unformatted code.


Back to problem 52