2013-03-26 22:16:00Morris
[UVA] 10633 - Rare Easy Problem
Problem B
Rare Easy Problem
Input: Standard Input
Output: Standard Output
Time Limit: 1 Second
By the way, John was later eaten by a tiger.
Input
Output
For each case, print one line containing the possible values of N in sorted order. Separate consecutive numbers with a single space.
Sample Input Output for Sample Input
18 0 |
19 20
|
Problemsetter: Derek Kisman, Member of Elite Problemsetters' Panel
Special Thanks: Monirul Hasan, Member of Elite Problemsetters' Panel
(Alternate Sol and Title of the Problem :))
“Without the constant support and, yes, competition, provided by all of the talented people here, many of us could not achieve our full potential; nor even, perhaps, realize what that potential is.”
-Derek Kisman
#include <stdio.h>
int main() {
long long G;
int i;
while(scanf("%lld", &G), G) {
int first = 0;
for(i = 9; i >= 0; i--) {
if((G-i)%9 == 0) {
if(first) putchar(' ');
first = 1;
printf("%lld", (G-i)/9*10+i);
}
}
puts("");
}
return 0;
}