fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long int n , dig , ans = 0 ;
  6. cin >> n;
  7. for (;n>0;){
  8. dig = n % 10 ;
  9. n = n / 10 ;
  10. ans = (ans * 10 )+ dig;
  11.  
  12. }
  13. cout << ans;
  14. }
Success #stdin #stdout 0s 5324KB
stdin
265
stdout
562