-
Notifications
You must be signed in to change notification settings - Fork 0
/
杭电 2099
55 lines (40 loc) · 1.05 KB
/
杭电 2099
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int index=0;
while(in.hasNext()) {
int n1 = in.nextInt();
int n2 = in.nextInt();
if(n1==0&&n2==0) {
break;
}else {
int i=0;
boolean flag = true;//原来这句话写到循环里面去了,就错了
while(i<100) {
int result = n1*100;
result +=i;
if(result%n2==0&&flag) {
System.out.print(String.format("%02d", i));//原来这里打印输出的格式不对,0没有补全为00
flag = false;
}else if(result%n2==0&&!flag){
System.out.print(" ");
System.out.print(String.format("%02d", i));
}else {
}
// else {
// a[index] = -1;
// }
i++;
//System.out.println(100);
}
// for(int j=0;j<a.length;j++) {//这么打印输出符合的两位数就麻烦了,根本不用记录到数组里
//
// if(a[j]!=-1)
// System.out.print(a[j]+" ");
// }
System.out.println();
}
}
}
}