1. 题目
读题
考查点
2. 解法
思路
代码逻辑
具体实现
public class HJ072 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
buy();
}
public static void buy() {
for (int i = 0; i <= 100 / 5; i++) {
for (int j = 0; j <= 100 / 3; j++) {
if (i * 5 * 3 + j * 3 * 3 + (100 - i - j) == 300) {
System.out.print(i);
System.out.print(" " + j);
System.out.println(" " + (100 - i - j));
}
}
}
}
}