ldcf.net
当前位置:首页 >> vB编程题,求解 >>

vB编程题,求解

'这题目对初学者,其实很有难度,运行效果如下Private Sub command1_click()Dim X As StringDim brrDim a As LongDim b As LongDim c As LongX = InputBox("请输入3个整数(以英文逗号分隔):", "求最大数", "例如:3,344,51", 1000, 1000)brr = ...

Private Function NewTon(n As Double, eps As Double) As Double Dim a(100) As Double Dim x As Double Dim y As Double Dim k As Double a(0) = 0 For i = 0 To 99 x = a(i) y = x ^ 3 - 2 * x ^ 2 + 4 * x + 1 k = 3 * x ^ 2 - 4 * x + 4 a(...

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

窗体上加一个按钮,完整代码如下: Option Explicit Private Type Record MyName As String * 1 MyAve As Single End Type Private Sub Command1_Click() Dim d(20, 5) As Integer Dim x As Integer Dim i As Integer Dim j As Integer Dim EvrA...

form添加一个按钮,复制代码,运行,输出最大数 Private Sub Command1_Click() Dim a, b, c a = Val(InputBox("请输入a:")) b = Val(InputBox("请输入b:")) c = Val(InputBox("请输入c:")) If a < b Then a = b If a < c Then a = c MsgBox "最大数...

if text1.text="小红" and text2.text="2011VBKS" then msgbox "欢迎参加VB考试!" else msgbox "输入数据有误!请重新输入……" end if

代码补充如下: Private Sub Command1_Click() Dim b() Dim i As Integer b = Array(16, 19, 19, 32, 50, 50, 50, 78, 80, 80, 95) For i = 0 To UBound(b) Text1.Text = Text1.Text & b(i) & Space(2) Next Call arrange(b) '补充代码 For i = ...

设计界面: 修改属性: 窗体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() Dim x As Double If IsNumeric(Text1.Text) Then x = Val(Text1.Text) Text2.Text = x * (-1) Text3.Text = x * x Text4.Text = Sqr(Abs(x)) Text5.Text = x * x * x Text6.Text = (Abs(x)) ^ (1 / 3) Else MsgBox...

Option Base 1 Dim intArray(5, 5) As Integer Private Sub Command1_Click() Randomize Dim i As Integer, j As Integer Me.Picture1.Cls For i = 0 To 2 Me.Text1(i).Text = "" Next i For i = 1 To 5 For j = 1 To 5 intArray(i, j) = Int(Rn...

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