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

Sub s() Dim i%, st&, sm& st = 1 For i = 1 To 10 st = st * i sm = sm + st Next Print smEnd Sub

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

Dim s As StringPrivate Sub Command1_Click() s = "" Dim oneNum As String oneNum = InputBox("请输入正整数:") MsgBox splitZhS(oneNum)End SubFunction splitZhS(b As String) As String If Val(b) > 10 Then s = s & Val(b) Mod 10 b = Va...

If duicheng(n) then sum=sum+( n) End ( Function )

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

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

求1000以内的所有守形数(设 a为一整数,若a^2=XXa,则称 a为守形数) 法一 函数 Private Sub Cd1_Click() Dim a As Long For a = 1 To 1000 Y = SS(a) If Y 0 Then Print a; "—"; Y Next a End Sub Function SS(X As Long) X1 = Trim(Str(X * X...

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