Reference solution
One correct implementation. Alternative approaches that satisfy the constraints are equally valid — the reviewer judges behaviour, not style.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s; cin >> s;
int l = 0, r = (int)s.size() - 1;
while (l < r) swap(s[l++], s[r--]);
cout << s << '\n';
return 0;
}