英语翻译Dim s,i,j,arr(1 To 10),t,sumFor i = 1 To 10s = InputBox(
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 07:39:54
英语翻译
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,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
这是一段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=真.
结束
端子
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=真.
结束
端子
英语翻译Dim s,i,j,arr(1 To 10),t,sumFor i = 1 To 10s = InputBox(
dim m(5,5),s(5) for i=1 to 5 s(i)=0 for j=1 to 5 m(i,j)=i+j
Dim arr(0 To 30,0 To 11) As Double for i = 1to31 arr(m-1,0)=
有如下程序dim arr(3,3) for j=1 to 3 for j=1 to 3 arr(j,k)=(j-1)*3
Dim a(4) s=0 For i=1 to 4 s=s+a(i) Next i
dim I% ,S% s=0 for I=5 to 1 s=s+i next I print “s=” ; s 怎么看的
dim a(10,10) as integer for i=1 to 10 for j=1to 10 a(i,j)=i*
..Dim a() a=Array(1,3,5,7,9) s=0 For i=1 To 4 s=s*10+a(i) Ne
s=s+arr(j,1)*Val(Mid(p,j,
DIM AS INTEGER A(6),I,T,J,P T=0 FOR I=1 TO 6:A(I)=7-I:NEXT F
Console.WriteLine("arr[{0},{1}]={2}",i,j,arr[i,j]) 请问C# 里 ar
Dim a(1 To 10) As Integer Dim i As Integer a(1) = 1 For i =