1、已知x,y,z 3个变量中存放了3个不同的数,比较它们的大小并进行调整,使得x x = InputBox(\y = InputBox(\z = InputBox(\ Print Tab(8); \ y\ z\Print \排序前:\ \ \If x < y Then t = x: x = y: y = t: If x < z Then t = x: x = z: z = t: If y < z Then t = y: y = z: z = t: Print \排序后:\ \ \End Sub 2.0到200 被5 或11 整除的数的和 Private Sub Command1_Click() Dim i% For i = 0 To 200 If i Mod 11 = 0 Ori Mod 5 = 0 Then Sum = Sum + i End If Next i Print \总和是\End Sub 3、从键盘输入三角形的三条边a,b,c的值,根据其数值,判断能形。 Private Sub Command1_Click() Dim a%, b%, c% a = Val(InputBox(\b = Val(InputBox(\c = Val(InputBox(\ If a + b > c And b + c > a And a + c > b Then MsgBox (\能构成三角形\Else MsgBox (\不能构成三角形\End If End Sub 4、随机产生10个[30,100]内的整数,求最小值及所对应的下标。 Private Sub Form_click() Dim a(1 To 10) As Integer, zb%, mina%, i% For i = 1 To 10 a(i) = Int(Rnd * 71 + 30) Print a(i); Next i zb = 1 mina = a(1) For i = 2 To 10 If mina >a(i) Then mina = a(i): zb = i Next i Print Print \下标=\End Sub 5、随机产生10个[30,100]内的整数,求最大值、最小值和平均值。 Dim a(1 To 10) As Integer, amin, amax, i%, avera! Private Sub Form_Click() For i = 1 To 10 a(i) = Int(Rnd * 71 + 30) Next i amin = a(1) amax = a(1) avera = a(1) For i = 2 To 10 If a(i) >amax Then amax = a(i) If a(i) For i = 1 To 10 Print a(i); Next i Print Print \End Sub 6、随机产生10个[30,100]内的整数,求最大值及所对应的下标 Private Sub Form_Click() Dim a(9), max%, imax% For i = 0 To 9 a(i) = Int(Rnd * 71 + 30) Print a(i); Next i Print max = a(0) For i = 1 To 9