2个回答
展开全部
Private Sub Command1_Click()
Dim i As Integer, bb(20) As Integer
'1
Dim k As Integer, dbl1 As Double
For i = 1 To 20
Randomize
bb(i) = Int(Rnd * 101)
bb(0) = bb(0) + bb(i)
Debug.Print bb(i);
Next i
dbl1 = bb(0) / 20
For i = 1 To 20
If bb(i) > dbl1 Then k = k + 1
Next i
Debug.Print , "平均分:"; dbl1, "高于平均分的人数:"; k
End Sub
Private Sub Command2_Click()
Dim i As Integer
'2
Dim k As Integer, dbl1 As Double
For i = 1 To 100
redo:
str1$ = InputBox("请输入第" & i & "个数:", "输入")
If Not IsNumeric(str1$) Then GoTo redo
dbl1 = Val(str1$)
If dbl1 = Int(dbl1) Then
Debug.Print dbl1;
k = k + 1
If k Mod 5 = 0 Then Debug.Print
End If
Next i
End Sub
Private Sub Command3_Click()
Dim i As Integer, j As Integer, cc(4, 4) As Integer
'3
For i = 0 To 4
For j = 0 To 4
Randomize
cc(i, j) = Int(Rnd * 91) + 10
Debug.Print cc(i, j);
Next j
Debug.Print
Next i
Debug.Print "转置"
For i = 0 To 4
For j = 0 To 4
Debug.Print cc(j, i);
Next j
Debug.Print
Next i
End Sub
Dim i As Integer, bb(20) As Integer
'1
Dim k As Integer, dbl1 As Double
For i = 1 To 20
Randomize
bb(i) = Int(Rnd * 101)
bb(0) = bb(0) + bb(i)
Debug.Print bb(i);
Next i
dbl1 = bb(0) / 20
For i = 1 To 20
If bb(i) > dbl1 Then k = k + 1
Next i
Debug.Print , "平均分:"; dbl1, "高于平均分的人数:"; k
End Sub
Private Sub Command2_Click()
Dim i As Integer
'2
Dim k As Integer, dbl1 As Double
For i = 1 To 100
redo:
str1$ = InputBox("请输入第" & i & "个数:", "输入")
If Not IsNumeric(str1$) Then GoTo redo
dbl1 = Val(str1$)
If dbl1 = Int(dbl1) Then
Debug.Print dbl1;
k = k + 1
If k Mod 5 = 0 Then Debug.Print
End If
Next i
End Sub
Private Sub Command3_Click()
Dim i As Integer, j As Integer, cc(4, 4) As Integer
'3
For i = 0 To 4
For j = 0 To 4
Randomize
cc(i, j) = Int(Rnd * 91) + 10
Debug.Print cc(i, j);
Next j
Debug.Print
Next i
Debug.Print "转置"
For i = 0 To 4
For j = 0 To 4
Debug.Print cc(j, i);
Next j
Debug.Print
Next i
End Sub
光点科技
2023-08-15 广告
2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件...
点击进入详情页
本回答由光点科技提供
2011-04-24
展开全部
Private Sub Command1_Click()
Dim a(1 To 5, 1 To 5), b(1 To 5, 1 To 5)
For i = 1 To 5
For j = 1 To 5
a(i, j) = Int(Rnd * 90 + 10)
Print a(i, j);
b(j, i) = a(i, j)
Next j
Print
Next i
Print
For i = 1 To 5
For j = 1 To 5
Print b(i, j);
Next j
Print
Next i
End Sub
Dim a(1 To 5, 1 To 5), b(1 To 5, 1 To 5)
For i = 1 To 5
For j = 1 To 5
a(i, j) = Int(Rnd * 90 + 10)
Print a(i, j);
b(j, i) = a(i, j)
Next j
Next i
For i = 1 To 5
For j = 1 To 5
Print b(i, j);
Next j
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询