更多"以下程序的功能是:从键盘上输入若干学生的成绩,统计计算出平均成绩,并输"的相关试题:
[填空题]以下程序的功能是:从键盘上输入若干学生的成绩,统计计算出平均成绩,并输出低于平均分的学生成绩,用输入负数结束输入。填空。 main( ) float x[1000],sum,=0.0,ave a; int n=0,i; printf("Enter mark:"/n");scanf("%f",&a); while(a>=0.0 & &n<1000) sum += 【10】 ;x[n]= 【11】 ; n+ +;scanf("%f",& a); ave= 【12】 ; printf("Output:"/n"); printf("ave=%f"/n",ave); for(i=0,i<n;i+ +) if( 【13】 )frintf("%f/n",x[i]);
[填空题]以下程序的功能是:从键盘上输入若干个数字,当输入负数时结束输入,统计出若干
数字的平均值,显示结果。请填空。
Private Sub Form_click( )
Dim x,y As Single
Dim z As Integer
x=InputBox("Enter a score")
Do while 【13】
y=y+x
z=z+1
x=InputBox("Enter a score")
Loop
If z=0 Then
z=1
End If
y=y/z
msgbox y
End Sub
[填空题]以下程序的功能是:从键盘上输入若干个数字,当输入负数时结束输入,统计出若干
数字的平均值,显示结果。请填空。
Private Sub Form_click( )
Dim x,y As Single
Dim z As Integer
x=InputBox("Enter a score")
Do while 【13】
y=y+x
z=z+1
x=InputBox("Enter a score")
Loop
If z=0 Then
z=1
End If
y=y/z
msgbox y
End Sub
[填空题]以下程序的功能是:从键盘上输入若干个数字,当输入负数时结束输入,统计出若干数字的平均值,输出结果。请填空。
Private Sub Form_click( )
Dim x,y As Single
Dim z As Integer
x=InputBox("Enter a score")
Do while 【8】
y=y+x
z=z+1
x=InputBox("Enter a score")
Loop
If z=0 Then
z=1
End If
y= 【9】
Print y
End Sub
[填空题]以下程序的功能是:从键盘输入若干个学生的成绩,统计出最高成绩和最低成绩,当输入负数时结束输入。
#include<stdio.h>
main( )
{float x,amax,amin;
scanf("%f",&x);
amax=x:
amin=x;
while( )/*第一空*/
{if(______)amax=x;/*第二空*/
if(x<amin)______;/*第三空*/
scanf("%f",&x);
}
printf("amax=%3.2f,amin=%3.2f/n",amax,amin);
}
[填空题]以下程序的功能是从键盘输入若干个学生的考试成绩,统计并输出最高分和最低分,当输入负数时结束输入。请填空。
Private Sub Command1_Click( )
Dim x,amax,amin As Single
x=InputBox("Enter a score")
amax=x
amin=x
Do While______
If x>amax Then
amax=x
End If
If______Then
amin=x
End If
x=InputBox("enter a score")
Loop
Print "max=";amax,"min=";amin
End Sub
[填空题]以下程序的功能是:从键盘上输入若干个学生的考试分数,当输入负数时结束输入,然后输出其中的最高分数和最低分数。请在 【8】 和 【9】 处填入适当的内容,将程序补充完整。
Private Sub Form_Click( )
Dim x As Single,amax As Single,amin As Single
x=Input Box("Enter a score")
amax=X
amin=x
Do While 【8】
If x>ama x Then
Ama x=x
End lf
If 【9】 Then
amin=X
End lf
x=Input Box("Enter a score")
Loop
Print”Max=";amax,"Min=";amin
End Sub
[填空题]以下程序的功能是,从键盘上输入若干数据,统计并输出最大值和最小值,当输入负数时结束输入,请填空。
Dim amax As Single,amin As Single
x=InputBox("请输入数据")
amax=x
amin=x
Do While 【8】
If x>amax Then
amax=x
End If
If 【9】 Then
amin=x
End If
x=InputBox("请输入数据")
Loop
Print "Max=";amax;"Min=";amin
End Sub