Untitled

mail@pastecode.io avatar
unknown
c_cpp
13 days ago
307 B
1
Indexable
Never
#include <iostream>
#include <math.h>
using namespace std;

string reverse(string a) {
	string b = a;
	int c = 0;
	for (int i = a.length() - 1; i >= 0; i--)
	{
		b[c] = a[i];
		c++;
	}
	return b;
}

int main() {
	setlocale(LC_ALL, "Russian");
	string a;
	cin >> a;
	cout << reverse(a);
}
Leave a Comment