Advertisement
edutedu

gata

Sep 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. int n, m, x,c=0,p=1,n1,i;
  2. cin>>n;
  3. n1=n;
  4. while(n)
  5. {
  6. n=n/10;
  7. c++;
  8. }
  9. if(c%2!=0)
  10. {
  11. for(i=1;i<=c/2;i++)
  12. {
  13. p=p*10;
  14. n=n1/(p*10)*p+n1%p;
  15. }
  16. cout<<n;
  17.  
  18. }
  19. else
  20. {x=n%10+(n/10)*10;
  21. cout<<x;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement