首页 > 编程知识 正文

尾数java整除的尾数 Java代码,java整除

时间:2023-05-04 16:54:52 阅读:257419 作者:1936

解题思路:

import java.util.*;

public class Text_1224 {

public static void main(Stringqsdmj args) {

Scanner sc = new Scanner(System.in);

while (sc.hasNext()) {

int a = sc.nextInt();

int b = sc.nextInt();

if (a == 0 && b == 0) {

break;

} else {

String s1 = String.valueOf(a);

for (int i = 0; i <= 9; i++) {

for (int j = 0; j <= 9; j++) {

String s2 = String.valueOf(i);

String s3 = String.valueOf(j);

String s4 = s1 + s2 + s3;

int result = Integer.parseInt(s4);

if (result % b == 0) {

System.out.print(s2 + s3 + " ");

}

}

}

}

}

}

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。