jordanov

funkcii ##prevrten

Dec 18th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 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 x,cifra,i,n;
  18.  
  19.     scanf("%d", &n);
  20.     for(i=0;i<n;i++)
  21.     {
  22.         scanf("%d%d", &cifra, &x);
  23.         printf("%d", prevrten(cifra, x));
  24.     }
  25.     return 0;
  26. }
Add Comment
Please, Sign In to add comment