will
|
分享:
▲
▼
我突然想到一種方法!! 可以寫1-2 就是 Dim q1 As String Dim q2 As String q1 = InputBox("數學=0 國文=1 英文=2", "請輸入帶查詢的科目代碼") q2 = InputBox("請輸入學生學號", "1~5") degree = 1 For r = 1 To 5 Step 1 If a(q1, q2) < a(q1, r) Then degree = degree + 1 End If Next r MsgBox "學生排名為" & degree, 0, "查詢結果" 當然還是要補上陣列 Dim a(3, 5) a(0, 1) = 20 a(0, 2) = 40 a(0, 3) = 30 a(0, 4) = 79 a(0, 5) = 74 a(1, 1) = 79 a(1, 2) = 81 a(1, 3) = 68 a(1, 4) = 62 a(1, 5) = 68 a(2, 1) = 43 a(2, 2) = 89 a(2, 3) = 62 a(2, 4) = 65 a(2, 5) = 78 請問這樣可以嗎? 還有請幫我想~~下一題! 主要的問題是~~~~點一下Command 使一個數值資料+1 這是怎樣辦到的>"< 萬是拜託~~由衷感謝!! 十萬火急阿
|
相信使世界變的美好!!
|
x0
[16 樓]
From:台灣中華電信
| Posted:2005-06-11 23:38 |
|
|
will
|
分享:
▲
▼
我硬搞了一個蠻陽春的寫法>"< 勉強可用= =" 可是我有一個問題!! 就是只要選課人數到30後再把text重新輸入其他的值程式就不動了!! 請問大大~~有哪裡可以修改的嗎?
(一般)(宣告) Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer Dim e As Integer
Private Sub Command1_Click() If a < 30 Then a = Val(Text1.Text) + 1 Text1.Text = a If a = 30 Then MsgBox "成功開課", 0, "選課結束!!" End If End If End Sub
Private Sub Command2_Click() If b < 30 Then b = Val(Text2.Text) + 1 Text2.Text = b If b = 30 Then MsgBox "成功開課", 0, "選課結束!!" End If End If End Sub
Private Sub Command3_Click() If c < 30 Then c = Val(Text3.Text) + 1 Text3.Text = c If c = 30 Then MsgBox "成功開課", 0, "選課結束!!" End If End If End Sub
Private Sub Command4_Click() If d < 30 Then d = Val(Text4.Text) + 1 Text4.Text = d If d = 30 Then MsgBox "成功開課", 0, "選課結束!!" End If End If End Sub
Private Sub Command5_Click() If e < 30 Then e = Val(Text5.Text) + 1 Text5.Text = e If e = 30 Then MsgBox "成功開課", 0, "選課結束!!" End If End If End Sub
Private Sub Command6_Click() If a < 5 Then Label1.Caption = "開課失敗" End If If a >= 5 And a <= 30 Then Label1.Caption = "開課成功" End If
If b < 5 Then Label2.Caption = "開課失敗" End If If b >= 5 And b <= 30 Then Label2.Caption = "開課成功" End If
If c < 5 Then Label3.Caption = "開課失敗" End If If c >= 5 And c <= 30 Then Label3.Caption = "開課成功" End If
If d < 5 Then Label4.Caption = "開課失敗" End If If d >= 5 And d <= 30 Then Label4.Caption = "開課成功" End If
If e < 5 Then Label5.Caption = "開課失敗" End If If e >= 5 And e <= 30 Then Label5.Caption = "開課成功" End If
End Sub
|
相信使世界變的美好!!
|
x0
[18 樓]
From:台灣中華電信
| Posted:2005-06-12 18:53 |
|
|
|