fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. string s;
  6. cin>>s;
  7. string rev;
  8. for(int i=s.length()-1;i>=0;i--)
  9. {
  10. rev=rev+s[i];
  11. }
  12. cout<<rev;
  13. }
Success #stdin #stdout 0.01s 5320KB
stdin
ram
stdout
mar