English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

該如何寫
1.控制九九乘法表 一次可以印幾排 <用inputbox>
ex : 如輸入的數字是 3排
1*1=1 2*1 =2 3*1 =3
1*2 =2 2*2=4 3*2=6
: : :
: : :
: : :

4*1 =4 5*1=5 6*1=6
: : :
如果輸入的是5 那麼會先印 1~5的乘法 再印 6~9的乘法

2.輸入一個小於1000的整數,程式成印出小於該整數的所有值數

3.輸入10進位 (小於 1000)轉換成 2進位 (使用迴圈 )

2005-12-18 10:48:01 · 3 個解答 · 發問者 Anonymous in 電腦與網際網路 程式設計

我可以問一下嗎 ?
如何才會如此呢↓↓
按一下 command1 圖片會變大 (或變小)
再按一下 command1 圖片又會變的更大(或變小)呢?

2005-12-19 08:57:36 · update #1

3.輸入10進位 (小於 1000)轉換成 2進位 (使用迴圈 )
輸入以 Text
輸出以 Label1

2005-12-19 08:59:50 · update #2

3 個解答

'放入Command1、Command2、Command3、List1
Private Sub Command1_Click()
Dim i%, j%, k%, n%
Cls
n = Val(InputBox("輸入一次要印幾排"))
For i = 1 To 9
For j = 1 To n
Print j; "x"; i; "="; i * j,
Next
Print
Next
Print
For i = 1 To 9
For k = n + 1 To 9
Print k; "x"; i; "="; i * k,
Next
Print
Next
End Sub

Private Sub Command2_Click()
Dim i As itn, j As Integer, chk As Boolean
For i = 2 To Val(InputBox("輸入一個小於1000的整數"))
chk = False
For j = 2 To Sqr(i)
If i Mod j = 0 Then chk = True
Next j
If Not chk Then List1.AddItem i
Next i
End Sub

Private Sub Command3_Click()
Dim BinaryStr As String, MyArr, DecNum As Long
DecNum = Val(InputBox("輸入10進位整數(小於1000)"))
BinaryStr = DecNum Mod 2
Do While DecNum >= 2
DecNum = DecNum \ 2
BinaryStr = DecNum Mod 2 & BinaryStr
Loop
Print BinaryStr
End Sub

2005-12-18 11:30:04 · answer #1 · answered by ? 6 · 0 0

可以麻煩您寄↓
鄧廣福~想一天就可以想你到永遠
這首歌給我嗎^^
非常感謝!!!
gingergin39@yahoo.com.tw

2005-12-23 16:44:58 · answer #2 · answered by Anonymous · 0 0

'第一題
Private Sub Command1_Click()
Dim I As Integer, J As Integer, Y As Integer
Lev = InputBox("輸入1~9之整數")
If Lev < 1 Or Lev > 9 Then Exit Sub
Cls
For I = 1 To 9 Step Lev
For J = 1 To 9
Y = 0
Do Until Lev - 1 = Y
If I + Y < 9 Then
Print I + Y & " X " & J & " = " & (I + Y) * J,
ElseIf I + Y = 9 Then
Print I + Y & " X " & J & " = " & (I + Y) * J
End If
Y = Y + 1
Loop
If I + Y < 10 Then Print I + Y & " X " & J & " = " & (I + Y) * J
Next
Print
Next
End Sub

2005-12-18 14:13:11 · answer #3 · answered by W.J.S. 7 · 0 0

fedest.com, questions and answers