(2)編寫程式張數

2023-01-19 10:20:29 字數 845 閱讀 7185

1樓:vb妮可

private sub command1_click()dim s$(10000), i%, r1%, r5%, r10%for r1 = 50 to 0 step -1for r5 = 10 to 0 step -1for r10 = 5 to 0 step -1if r1 * 1 + r5 * 5 + r10 * 10 = 50 then

i = i + 1

s(i) = "1元=" & r1 & "張,5元=" & r5 & "張,10元=" & r10 & "張"

end if

next

next

next

s(0) = "共有" & i & "種方法:"

text1 = join(s, vbcrlf)end sub

2樓:秋色烽火

const rmb as integer = 50dim id as integer

private sub form_click()for i = 1 to rmb \ 10for j = 1 to rmb \ 5

for k = 1 to rmb \ 1

if i <> 0 and j <> 0 and k <> 0 then

if 10 * i + 5 * j + k = rmb thenid = id + 1

print "(" & id & ")" & vbtab & "10-[" & i & "] 5-[" & j & "] 1-[" & k & "]"

end if

end if

next

next

next

end sub

vb編寫程式計算分段函式,VB編寫程式,計算分段函式

在窗體上放一個命令按鈕,將 複製到窗體裡,程式執行單擊一次命令按鈕可輸入一次n的值 如下 private sub command1 click dim n,y as single n inputbox 請輸入n的值 select case n case is 0 y 2 n 5 case 0 y 0...

用指標編寫程式,用指標編寫一個程式

include include include define max 100 輸入的最大字元數為100 int main printf character total number is d n total printf upper character number is d n count upp...

組合語言程式編寫程式顯示藍屏

對的,建立彩色文字區80 25比較穩定,如果你要顯示滿屏,請把 mov cx,25 這一句中的25改成50 或75,即25的倍數,400 即可。assume cs code code segment start mov ax,0b800hmov es,ax mov di,0 mov cx,25 s ...