Advertisement
yoyoboyss

Untitled

Feb 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. int x;
  8. int a1=0, a2=0, a3=0;
  9. int x1=0, x2=0;
  10. cout << "x= "; cin >> x;
  11. for(int i=1; i<=5; i++){
  12. if(i == 3)
  13. a3 = x % 10;
  14. if(i > 1 && i < 5)
  15. a2 = a2 * 10 + x % 10;
  16. a1 = a1 * 10 + x % 10;
  17. x /= 10;
  18. }
  19. for(int i=1; i<=5; i++){
  20. if(i > 1 && i < 5){
  21. x2 = x2 * 10 + a2 % 10;
  22. a2 /= 10;
  23. }
  24. x1 = x1 * 10 + a1 % 10;
  25. a1 /= 10;
  26. }
  27. cout << " " << a3 << "\n " << x2 << "\n" << x1;
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement