ldcf.net
当前位置:首页 >> vB程序题求代码 >>

vB程序题求代码

程序图标自己更改,基本功能已实现,详见附件。form1代码Private Sub about_Click() Form2.ShowEnd SubPrivate Sub Comm...

'这题目,对于初学者是很有难度的,'运行效果如上图,代码如下:'有问题可以问我Private Sub Command1_Click()Dim arr(1 To 20) As IntegerDim i, a, b As IntegerDim Ave As DoubleDim sum As IntegerDim Mx, Mn As IntegerPrint "随机数数组...

Private Sub C1_Click() Dim i%, n% P1.Cls For i = 0 To 2 If Op1(i).Value = True Then n = i Next Select Case n Case 0 P1.Print "选择了正方形" Case 1 P1.Print "选择了椭圆形" Case 2 P1.Print "选择了圆形" End Select End Sub Private ...

Private Sub Command1_Click() Randomize Text1 = "" n = CInt(InputBox("N=")) For i = 1 To n x = Int(Rnd * 90) + 10 If x Mod 2 = 1 Then Text1 = Text1 & x & " " n1 = n1 + 1 If n1 Mod 10 = 0 Then Text1 = Text1 & vbCrLf s1 = s1 + x ...

设计界面: 修改属性: 窗体Frm1代码: Public n% '定义公共变量Private Sub Command1_Click() Frm2.ShowEnd SubPublic Sub Command2_Click() Print nEnd Sub窗体Frm2代码: Private Sub Command1_Click() If MsgBox("退出程序吗?", vbYesNo, "...

Private Sub Command1_Click() x = InputBox("键入第一个数") y = InputBox("键入第二个数") z = InputBox("键入第三个数") Max = x If Max < y Then Max = y If Max < z Then Max = z Print "最大值"; Max End Sub

一、要产生1到100之间的随机数,首先了解Rnd函数的用法,Rnd函数产生的是0和1之间的随机数,范围是[0,1),包括0,但不包括1。因此要产生1~100之间的随机数,可以使用Rnd*98,产生的是[0,98)的随机数,而int(Rnd*98)产生的是[0,97]之间的随机整数...

Private Sub Clear_Click() Text1.Text = "" Text2.Text = "" List1.Clear Text1.SetFocus End Sub Private Sub Lookup_Click() Dim i As Integer, j As Integer, c As String, b(50) As String, k As Integer, t As String c = Me.Text1.Text F...

Function getMax() As Integer Dim i As Integer, rt As Integer rt = Num(0) For i = 1 To 9 If Num(i) > t Then t = Num(i) Next getMax = rt End Function Function getMin() As Integer Dim i As Integer, rt As Integer rt = Num(0) For i ...

Private Sub Form_Click()Dim s(10) As spDim i As Integer, j As IntegerFor i = 1 To 10s(i).id = InputBox("请输入运动员号:", "提示", 1)s(i).cs = InputBox("请输入运动员成绩", "提示", 1)NextFor i = 1 To 10For j = 1 To 9If s(j).cs <...

网站首页 | 网站地图
All rights reserved Powered by www.ldcf.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com