fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main() {
  7. //freopen("input.txt","r", stdin );
  8. //freopen ("output.txt", "w",stdout);
  9. // your code goes here
  10. int a,m;
  11.  
  12. cin>>a;
  13. int c1 = a/100;
  14. int c2 = (a%100)/10;
  15. int c3 = (a%100)%10;
  16. int c4 = a%10;
  17. m = (1000*c4)+(100*c3)+(10*c2)+c1;
  18. cout<<m;
  19. return 0;
  20. }
Success #stdin #stdout 0s 16064KB
stdin
4321
stdout
1163