/*
* 1块钱换成1分 2分 5分有好多种换法?
*/
public class Demo3 {
public static void main(String[] args) {
int a = times(1);
System.out.println(a);
}
public static int times(int z){
int count=0;
for (int i = 0; i <=100; i++) {
for (int x = 0; x <= 50; x++) {
for (int y = 0; y <= 20; y++) {
if((x*2+y*5+i)==100){
count++;
System.out.println("["+i+","+x+","+y+"]");
}
}
}
}
return count;
}
} |
|