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

vB编程题,求解

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

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 "最大数...

Private Sub Form_Load()Text1.FontSize = 10End SubPrivate Sub command1_click()Text1.FontSize = 10 + Int(Rnd * 3 + 1)End SubPrivate Sub command2_click()Text1.FontSize = 10 - Int(Rnd * 3 + 1)End SubPrivate Sub command3_click()Text...

Private Sub Command1_Click() n = CInt(InputBox("求N!,请输入N的值:")) s = 1 For i = 2 To n s = s * i Next i MsgBox ("N!=" & s) End Sub

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

第一空 变量i,因为下面用的的是第一重循环的变量;第二空 1 因为输出的图形是随着第一重循环的变化而变化的! 也就是: 变量 i =1 的时候 ,输出1个*;变量 i =2 的时候 ,输出2个*,以此类推!

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

Dim Sign As String, Flag As BooleanPrivate Sub Command1_Click() Dim DecimalNumber As Double DecimalNumber = TransformBtoD(Text1.Text) Label2.Caption = "转换成十进制数为:" + Sign + CStr(DecimalNumber)End SubPrivate Function Tra...

第一题: Private Sub Form_Click() Form1.AutoRedraw = True Dim i As Integer, j As Integer Dim k As Integer For i = 100 To 200 If Prime(i) Then k = k + 1 Print i; If k Mod 10 = 0 Then Print End If Next Print Print "100-200之间共...

6 -29 看到这类题目就想吐,这种题目非常简单,但如果考笔试答到试卷上的话却很容易答错,真怀疑出题者那满脑子里是狗 shi

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