Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int a,i,s,k,m,p;
- int main() {
- m = 0;
- p = 1;
- k = 1000;
- scanf("%i",&a);
- for (i = 1;i < 4;i++){
- k = k/10;
- s = a/k;
- m = m+s*p;
- p = p*10;
- a = a-s*k;
- }
- printf("%i\n",m);
- return 0;
- }
Add Comment
Please, Sign In to add comment