//小明单位发了100元的购物卡,小明到超市买三类洗化用品,
//洗发水(15元),香皂(2元),牙刷(5元)。
//要把100元整好花掉,可如有哪些购买结合?
public class A09购物卡 {
public static void main(String[] args) {
int count=0;
//洗发水
for (int i = 0; i <=100/15; i++) {
//香皂
for (int j = 0; j <=100/2; j++) {
//牙刷
for (int j2 = 0; j2 <=100/5; j2++) {
if(i15+j2+j2*5==100){
System.out.println("洗发水"+i+"香皂"+j+"牙刷"+j2);
count++;
}
}
}
}
System.out.println("方案数量:"+count);
}
}