#P10985. [蓝桥杯 2023 国 Python A/Java A] 整数变换
[蓝桥杯 2023 国 Python A/Java A] 整数变换
Background
Python contestants are advised to submit this problem using PyPy3.
Problem Description
Xiao Lan has an integer . Every minute, Xiao Lan's number changes to the number from the previous minute minus the sum of its digits.
For example, if Xiao Lan's number starts as , then the next minute it becomes . The minute after that it becomes . The minute after that it becomes . In total, it takes minutes to become .
Given a positive integer, find how many minutes it will take for this number to become .
Input Format
Input one line containing an integer .
Output Format
Output one integer, which is the answer.
23
3
Hint
For of the test cases, .
For of the test cases, .
For all test cases, .
Translated by ChatGPT 5