Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static public void KolvoCifr(int n)
- {
- int i = 0;
- int sum = 0;
- int buf = n;
- while (n > 0)
- {
- sum=0;
- buf=n;
- while (buf != 0)
- {
- sum = sum + buf % 10;
- buf = buf / 10;
- }
- n-=sum;
- i++;
- System.out.println(n);
- }
- System.out.println(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement