fork(1) download
  1. #include<iostream>
  2. #include<iomanip>
  3. #include<cmath>
  4. #include<math.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. int n,ch,c1,c2,c3;
  12.  
  13. //freopen("input.txt","r",stdin);
  14. //freopen("output.txt","w",stdout);
  15. cin >> n;
  16. c2 = n % 10;
  17. c3 = (n % 100) / 10;
  18. c1 = n / 100;
  19. ch = c1 * 100 + c2 * 10 + c3;
  20. cout << ch <<endl;
  21. return 0;
  22. }
  23.  
  24.  
  25. int n = 546;
  26. int x2 = n % 10; // вторая цифра (в оригинале)
  27. int x3 = (n % 100) / 10; // третья цифра
  28. int x1 = n / 100; // первая цифра
  29. int x = x1 * 100 + x2 * 10 + x3;
Success #stdin #stdout 0s 3472KB
stdin
123
stdout
132