Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int n = 0;
- int r = 0;
- int t = 0;
- scanf("%d", &n);
- for (; n; n /= 10)
- {
- const int d = n % 10;
- r += d != 1 ? d * (int)pow(10, t++) : 0;
- }
- printf("%d", r);
- return 0;
- }
Add Comment
Please, Sign In to add comment