首页 / 生态

vb语言程序设计作品 vb语言程序设计是什么

发布时间:2024-07-22 23:57:17

今天来聊聊关于vb语言程序设计作品,vb语言程序设计是什么的文章,现在就为大家来简单介绍下vb语言程序设计作品,vb语言程序设计是什么,希望对各位小伙伴们有所帮助。

1、Option ExplicitPrivate Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Static r As Integer Static ct As Integer Static n As Integer If Command1.Caption = "开始" Or Command1.Caption = "下一题" Then a = Int(Rnd() * 90) 10 b = Int(Rnd() * 90) 10 c = Int(Rnd() * 4) Select Case c Case 0 Label2.Caption = a & " " & b & " = ?" r = a b Case 1 If a < b Then r = a a = b b = r End If Label2.Caption = a & " - " & b & " = ?" r = a - b Case 2 a = Int(Rnd() * 100) 1 b = Int(Rnd() * 100) 1 If a < b Then r = a a = b b = r End If r = a b If r = 0 Then r = 1 a = b * r a = r Label2.Caption = a & " * " & b & " = ?" r = a * b Case 3 a = Int(Rnd() * 100) 1 b = Int(Rnd() * 100) 1 If a < b Then r = a a = b b = r End If r = a b If r = 0 Then r = 1 a = b * r Label2.Caption = a & " / " & b & " = ?" r = a b End Select Command1.Caption = "提交答案" Label3.Caption = "" Text1.Text = "" Else If Text1.Text = "" Then MsgBox "请输入答案", vbCritical Exit Sub End If Label2.Caption = Left(Label2.Caption, Len(Label2.Caption) - 1) & Text1.Text n = n 1 If Val(Text1.Text) = r Then Label3.Caption = "√" Label3.ForeColor = vbBlue ct = ct 1 Else Label3.Caption = "×" & "(正确答案:" & r & ")" Label3.ForeColor = vbRed End If List1.AddItem Label2.Caption & Label3.Caption Command1.Caption = "下一题" Label1.Caption = "正确率" & Format(ct / n, "00.0%") End IfEnd SubPrivate Sub Form_Load() Command1.Caption = "开始" Label1.Caption = "正确率:0%" Label2.Caption = "点开始按钮答题" Label3.Caption = "" Text1.Text = "" Randomize TimerEnd Sub不明白的加百度HI给你发代码。

相信通过vb语言程序设计是什么这篇文章能帮到你,在和好朋友分享的时候,也欢迎感兴趣小伙伴们一起来探讨。

免责声明:本文为转载,非本网原创内容,不代表本网观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。

如有疑问请发送邮件至:bangqikeconnect@gmail.com