fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int i = 100;
  8. stringstream ss,aa;
  9. ss << i;
  10. string number;
  11. ss >> number;
  12. string tmp = string(number.rbegin(),number.rend());
  13. cout << tmp << endl;
  14. aa << tmp;
  15. aa >> i;
  16. cout << i <<endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 4392KB
stdin
Standard input is empty
stdout
001
1