Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int number = 0,sum = 0,another = 0,calc = 0;
- scanf("%d",&number);
- while (number > 0)
- {
- sum = 0;
- another = number;
- while (another > 0)
- {
- sum += another % 10;
- another /= 10;
- }
- number -= sum;
- ++calc;
- }
- printf("%d",calc);
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement