Advertisement
edutedu

Untitled

Nov 18th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int rotire(int n)
  5. {
  6. int p=100, m, pr, nr_nou;
  7. m=n;
  8. while(n>9)
  9. {
  10. n=n/10;
  11. }
  12. pr=n;
  13. nr_nou=(m%10)*10+pr;
  14. m/=10;
  15. while(m!=0)
  16. {
  17. nr_nou=(m%10)*p+nr_nou;
  18. p=p*10;
  19. m/10;
  20. }
  21. return nr_nou;
  22. }
  23.  
  24. int main()
  25. {
  26. int n;
  27. cin>>n;
  28. cout<<rotire(n);
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement