英语翻译Dim s,i,j,arr(1 To 10),t,sumFor i = 1 To 10s = InputBox("输入评分(0-10分):","第" & i &"个分数")If IsNumeric(s) Thens = Val(s)If s < 0 Or s > 10 Theni = i - 1Elsearr(i) = sEnd IfElsei = i - 1End IfNextFor i = 1 To 9For j = i
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 16:51:27
英语翻译Dim s,i,j,arr(1 To 10),t,sumFor i = 1 To 10s = InputBox("输入评分(0-10分):","第" & i &"个分数")If IsNumeric(s) Thens = Val(s)If s < 0 Or s > 10 Theni = i - 1Elsearr(i) = sEnd IfElsei = i - 1End IfNextFor i = 1 To 9For j = i
英语翻译
Dim s,i,j,arr(1 To 10),t,sum
For i = 1 To 10
s = InputBox("输入评分(0-10分):","第" & i &"个分数")
If IsNumeric(s) Then
s = Val(s)
If s < 0 Or s > 10 Then
i = i - 1
Else
arr(i) = s
End If
Else
i = i - 1
End If
Next
For i = 1 To 9
For j = i + 1 To 10
If arr(i) > arr(j) Then
t = arr(i):arr(i) = arr(j):arr(j) = t
End If
Next
Next
For i = 2 To 9
sum = sum + arr(i)
Next
Label1.Caption = "最高分为:"& arr(10)
Label2.Caption = "最低分为:"& arr(1)
Label3.Caption = "选手最后得分:"& Round(sum / 8,1)
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Command1.Caption = "评分"
Command2.Caption = "结束"
With Label1
.Caption = ""
.AutoSize = True
End With
With Label2
.Caption = ""
.AutoSize = True
End With
With Label3
.Caption = ""
.AutoSize = True
End With
End Sub
英语翻译Dim s,i,j,arr(1 To 10),t,sumFor i = 1 To 10s = InputBox("输入评分(0-10分):","第" & i &"个分数")If IsNumeric(s) Thens = Val(s)If s < 0 Or s > 10 Theni = i - 1Elsearr(i) = sEnd IfElsei = i - 1End IfNextFor i = 1 To 9For j = i
这是一段VB脚本代码
Dim s,i,j,arr(1 To 10),t,sum ‘定义变量
For i = 1 To 10
一个循环I的值循环10次1-10如果ISNUMERIC(S)然后
S =瓦尔(S)
如果S<0或10则
我为我1
其他的
ARR(我)=S
最后如果
其他的
我为我1
最后如果
下一个
我=1至9
J=我+1至10
如果ARR(我)>ARR(J)然后
T=ARR(我):ARR(我)=ARR(J):ARR(J)=T
最后如果
下一个
下一个
我=2至9
金额=总和+ARR(我)
下一个
“最高分为Label1.标题:“ARR(10)
“最低分为label2.标题:“ARR(1)
label3.标题“选手最后得分:“圆(和/8,1)
端子
私人子command2_click()
卸下我
端子
私人子form_load()
标题=“评分COMMAND1.”
command2标题=“结束”.
随着label1
解说词.
AutoSize=真.
结束
随着label2
解说词.
AutoSize=真.
结束
与label3
解说词.
AutoSize=真.
结束
端子