Advertisement
jordanov

prevrten

Dec 18th, 2015
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int prevrten(int x, int cifra)
  5. {
  6. while(x)
  7. {
  8. cifra = x%10;
  9. x = x*10 +cifra;
  10. x/=10;
  11. }
  12. return x;
  13. }
  14.  
  15. int main()
  16. {
  17. int cifra,i,n;
  18.  
  19. scanf("%d", &n);
  20. for(i=0;i<n;i++)
  21. {
  22. scanf("%d", &cifra);
  23. printf("%d", prevrten(cifra));
  24. }
  25.  
  26.  
  27.  
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement