fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int a;
  8. cin >> a;
  9. int reverseA = 0;
  10.  
  11. while (a) {
  12. reverseA = reverseA * TEN + a % TEN;
  13. a /= TEN;
  14. }
  15. cout << reverseA;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
46723