Advertisement
lammac

Tìm số đảo ngược của 1 số

Apr 3rd, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int n, tmp;
  4.     scanf("%d", &n);
  5.     int res = 0;
  6.     while(n>0){
  7.         tmp = n%10;
  8.         res = res*10 + tmp;
  9.         n = n/10;
  10.     }
  11.     printf("%d", res);
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement