共4562种
qbasic吧
全部回复
仅看楼主
level 0
瞎写的。解决对正确。但是时间复杂度极高,不实用C
LSP
RINT "Press A to display."dollor = 100FOR fifcent = 0 TO 100 STEP 50 FOR twecent = 0 TO 100 STEP 20 FOR tencent = 0 TO 100 STEP 10 FOR fivecent = 0 TO 100 STEP 5 FOR twocent = 0 TO 100 STEP 2 FOR cent = 0 TO 100 IF cent + twocent + fivecent + tencent + twecent + fifcent = dollor THEN PRINT cent; "cent+"; twocent / 2; "twocent+"; fivecent / 5; "fivecent+"; tencent / 10; "tencent+"; twecent / 20; "twecent+"; fifcent / 50; "fifcent = 1 dollor": i = i + 1 NEXT cent NEXT twocent NEXT fivecent NEXT tencent NEXT twecentNEXT fifcentPRINT "i="; i
2004年03月22日 11点03分 2
level 0
那一定有其他的条见否着真的很繁哦这为一定是都考虑了把?
2005年02月04日 08点02分 4
level 0
CLS 
 
dollor = 100 
FOR fifcent = 0 TO 100 STEP 50 
 FOR twecent = 0 TO 100 STEP 20 
 FOR tencent = 0 TO 100 STEP 10 
 FOR fivecent = 0 TO 100 STEP 5 
 FOR twocent = 0 TO 100 STEP 2 
 FOR cent = 0 TO 100 
 IF cent + twocent + fivecent + tencent + twecent + fifcent = dollor THEN PRINT cent; "cent+"; twocent / 2; "twocent+"; fivecent / 5; "fivecent+"; tencent / 10; "tencent+"; twecent / 20; "twecent+"; fifcent / 50; "fifcent = 1 dollor": i = i + 1 
 NEXT cent 
 NEXT twocent 
 NEXT fivecent 
 NEXT tencent 
 NEXT twecent 
NEXT fifcent 
PRINT "i="; i
2009年05月23日 08点05分 5
1