信息技术学业水平测试VB套操作题复习及答案解答.ppt

信息技术学业水平测试VB套操作题复习及答案解答.ppt

Private Sub Command1_Click() Dim h, m, s, ss As Integer ss = Val(Text1.Text) h = ss \ 3600 m = (ss - h * 3600) \ 60 s = (ss - h * 3600) Mod 60 Label1.Caption = CStr(h) Label2.Caption = CStr(m) Label3.Caption = CStr(s) End Sub;Private Sub Command1_Click() Dim x As String, y As String Dim i As Integer Dim temp1 As String, temp2 As String x = Text1.Text y = For i = 1 To Len(Text1.Text) temp1 = Mid(x, i, 1) temp2 = 9 - temp1 y = y + temp2 Next i Text2.Text = y End Sub;Private Sub Command1_Click() Dim i As Integer, a As Integer, b As Integer, c As Integer For i = 100 To 999 a = i \ 100 b = (i - a * 100) \ 10 c = i Mod 10 If a ^ 3 + b ^ 3 + c ^ 3 = i Then Print i Next i End sub;Private Sub Command1_Click() Dim s(9) As Single For i = 0 To 9 s(i) = Val(InputBox(请输入一个数)) Next i For i = 9 To 0 Step -1 Print s(i) Next i End Sub;Private Sub Command1_Click() Dim a, b, c, max As Integer a = Val(Text1.Text) b = Val(Text2.Text) c = Val(Text3.Text) If a b Then max = a Else max = b If c max Then max = c Label3.Caption = CStr(max) End Sub;VB操作二打不开 ;Private Sub Command1_Click() Dim year As Integer year = Val(InputBox(请输入年号:)) If ((year Mod 4 = 0) And (year Mod 100 0)) Or (year Mod 400 = 0) Then Print 是闰年 Else Print 不是闰年 End If End Sub;Private Sub Command1_Click() Dim a As Integer, b As Integer Dim bai As Integer, shi As Integer Dim g As Integer a = Val(Text1.Text) bai = a \ 100 shi = (a - bai * 100) \ 10 g = a Mod 10 b = g * 100 + shi * 10 + bai Text2.Text = CStr(b) End Sub;Private Sub Command1_Click() Dim x As Single, y As Single a = 3: b = -5 x = Val(InputBox(请输入x的值)) If x 0 Then y = x + 5 * a Else y = x - 2 * b End If Print y=; CStr(y) End Sub;Private Sub Command1_Click()

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档