Posted on 2009-07-01 16:25
Hero 阅读(126)
评论(0) 编辑 收藏 引用 所属分类:
代码如诗--ACM
1 //HLOJ 1140 Accepted 0 120 478 C++
2
3 #include <stdio.h>
4
5 int inn, inm ;
6
7 int main()
8 {
9 while( scanf( "%d %d", &inn, &inm ) != EOF )
10 {
11 if( 0 == inm && 0 == inn ) break ;
12
13 inn = inn *100 ;
14 char *p = "" ;
15 for( int i=0; i<=99; i++ )
16 {
17 int temp = inn + i ;
18 if( temp % inm == 0 )
19 {
20 if( i < 10 )
21 {
22 printf( "%s0%d", p, i ) ;
23 p = " " ;
24 }
25 else
26 {
27 printf( "%s%d", p, i ) ;
28 p = " " ;
29 }
30 }
31 }
32 printf( "\n" ) ;
33 }
34
35 return 0 ;
36 }