【74由几个1几个5几个10几个20组成】
1 var num = 74; 2 for(one = 0; one <= num; one++){ 3 for(five = 0; five <= num/5 ; five++){ 4 for(ten = 0; ten <= num/5 ; ten++){ 5 for(twenty = 0; twenty <= num/20; twenty++){ 6 if(one + five*5 + ten*10 + twenty*20 == num){ 7 console.log(one + "个1," + five + "个5," + ten +"个10," + twenty + "个20组成。"); 8 } 9 } 10 } 11 } 12 }