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