用VB编程,利用窗口输入10个数,求这10个数的最大值

如题所述

第1个回答  2010-12-07
dim a(10)!
for i=0 to 9
a(i)=inputbox("请输入第" & (i+1) & "个数")
next i
max=a(0)
for i= 1 to 9
if a(i)>max then max=a(i)
next i
print "最大数是";max本回答被提问者采纳

用VB编程,利用窗口输入10个数,求这10个数的最大值
a(i)=inputbox("请输入第" & (i+1) & "个数")next i max=a(0)for i= 1 to 9 if a(i)>max then max=a(i)next i print "最大数是";max

vb编程,输入十个数字,找出最大值,并找出最大值的位置。
i As IntegerEnd TypeDim a(10) As numDim temp As numPrivate Sub Command1_Click()For i = 1 To 10 a(i).i = InputBox("请输入第" & i & "个数字") a(i).xuhao = i Print a(i).iNext iFor i = 1 To 10 For j = 1 To 10 - i If a(j).i > ...

VB编程 利用inputbox函数输入10个数,找出最大数 并输出。
For i = 1 To 10 改成 For i = 0 To 9 试一下 汗……有Option Base 1啊……看出来了,是这样子的,因为你在输入之前就定义了Min=s(1)此时,s(1)=0,所以之后只要你输入的正数就不会比0小了,应该将Min定义成一个大数,比如使成绩的话,Min=100这样就不会错了 ...

利用VB制作一个“随机生成十个数字(1-100之间的整数)求极值(最大最小...
Dim max, min As IntegerDim avg As DoublePrivate Sub Command1_Click()Dim num(10) As IntegerText1.Text = ""Label4.Caption = ""Label5.Caption = ""Label6.Caption = ""Dim i, j, temp, sum As Integersum = 0For i = 1 To 10num(i) = Int(Rnd * (100 + 1))sum = s...

...随机产生10个1-100以内的整型数,求出其的最大值,最小值,平均值_百...
max%, min%,s For i = 1 To 10 Randomize j = Int(Rnd * 100 + 1)If i = 1 Then min = j If j > max Then max = j If j < min Then min = j s = s + j Print j;Next Print Print "最大值,最小值,平均数分别为:"; max; min; Cdbl(s) \/ 10 End Sub ...

VB编程题 随机产生10个成绩,求最高分和平均值
To 10) As Integer For i = 1 To 10 arr(i) = Rnd * 100 Print arr(i) If m < arr(i) Then m = arr(i) n = n + arr(i) \/ 10 Next Print "最大值为:" & m & ",平均值为:" & nEnd Sub ...

vb编程:随机产生10个两位随机奇数,求其中的最大值、最小值和平均值
Randomize j = Int(Rnd * 100) + 10 Loop a(i) = j Next i Label1.Caption = "这10个数为:"For i = 0 To 9 Label1.Caption = Label1.Caption & a(i) & " "Next i j = a(0) '求最大数 For i = 1 To 9 j = IIf(j > a(i), j, a(i))Next i Label2.C...

用VB编程输入10名学生某一门课的成绩,求出其中的最高分,最低分和所有...
For i = 1 To 10 score(i) = Val(InputBox("请输入第 " & Str(i) & "个学生的成绩", "成绩统计", ""))Text1.Text = Text1.Text & Str(score(i))Next i s = 0: max = score(1): min = score(1)For i = 1 To 10 If score(i) > max Then max = score(i)If ...

求vb编程 十个学生成绩的最高分,平均分,最低分
单击command4按钮,用inputbox()函数输入10个成绩数据,并在picture1图形框中显示所输入的成绩:单击command1按钮,在text1文本框中显示最高分;单击command2按钮,在text2文本框中显示最低分;单击command3按钮,在text3文本框中显示平均分 Option Explicit Dim sdt(1 To 10) As Double Private Sub ...

帮我解一下这道VB编程题:“随机产生10个两位整数,找出其中的最大值...
single randomize for i=0 to 9 a(i)=int(rnd*90+10)next max=a(0)min=a(0)for i=0 to 9 if a(i)>max then max=a(i)if a(i)<min then min=a(i)avg=avg+a(i)next avg = avg \/10 print "最大值为" & max & ",最小值为" & min & ", 平均值为" & avg ...

相似回答