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 |
|
|
|