c语言sscanf函数的用法是什么
254
2022-09-02
codeforces 875A Classroom Watch
Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number n. He asked what is this number and the teacher of mathematics Inna Petrovna answered Vova that n is the answer to the arithmetic task for first-graders. In the textbook, a certain positive integer x was given. The task was to add x to the sum of the digits of the number x written in decimal numeral system. Since the number n on the board was small, Vova quickly guessed which x could be in the textbook. Now he wants to get a program which will search for arbitrary values of the number n for all suitable values of x or determine that such x does not exist. Write such a program for Vova. Input The first line contains integer n (1 ≤ n ≤ 109). Output In the first line print one integer k — number of different values of x satisfying the condition. In next k lines print these values in ascending order. Examples Input 21 Output 1 15 Input 20 Output 0 Note In the first test case x = 15 there is only one variant: 15 + 1 + 5 = 21. In the second test case there are no such x. 仔细观察性质可以发现最大不超过9*9那么我们直接枚举就好了
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~