解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class C1224 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int a = sc.nextInt(), b = sc.nextInt(); if(a == 0 && b == 0) break; StringBuffer sb = new StringBuffer(); int num = 0; for(int i = 0; i <= 9; i++){ num = a*100 + i; if(num % b == 0) sb.append(String.format("0%d ", i)); } for(int i = 10; i <= 99; i++){ num = a*100 + i; if(num % b == 0) sb.append(String.format("%d ", i)); } if(sb.length() > 0) System.out.println(sb.substring(0, sb.length()-1)); } sc.close(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:749 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)万恶的long long浏览:875 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:636 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:879 |
C语言考试练习题_保留字母 (C语言代码)浏览:700 |
母牛的故事 (C语言代码)浏览:549 |
简单的a+b (C语言代码)浏览:543 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:579 |
数组输出 (C语言代码)浏览:700 |
C语言训练-大、小写问题 (C语言代码)浏览:674 |