高一数学题(程序类的)2007全国舞蹈电视大赛总决赛共忧24个队参加,并请了12名评委,在计算每队选手的得分时,为了避免个别评委所给的极端分数的影响,按常规必须去掉一个最高分和一个最底分后再求平均分.如果采用百分制,请画出求某队平均分的程序框图,并写出程序.
2019-04-13
高一数学题(程序类的)
2007全国舞蹈电视大赛总决赛共忧24个队参加,并请了12名评委,在计算每队选手的得分时,为了避免个别评委所给的极端分数的影响,按常规必须去掉一个最高分和一个最底分后再求平均分.如果采用百分制,请画出求某队平均分的程序框图,并写出程序.
优质解答
OPTION BASE 1
DIM a(12),S
PRINT
PRINT ""
FOR i = 1 TO 12
PRINT "No"; i
INPUT "Please input the score from umpire:",a(i)
PRINT "--------------------------------------"
NEXT i
PRINT
PRINT "Now,display the scores from all umpires:"
PRINT
FOR j = 1 TO 12
PRINT a(j);
NEXT j
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "Now,reorder these scores:"
PRINT
FOR m = 1 TO 11
FOR n = m + 1 TO 12
IF a(m) > a(n) THEN SWAP a(m),a(n)
NEXT n
NEXT m
FOR k = 1 TO 12
PRINT a(k);
NEXT k
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "Now,delete the maximal and the minimal scores:"
PRINT
S = 0
FOR t = 2 TO 11
PRINT a(t);
S = S + a(t)
NEXT t
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "The result is:"
PRINT "---------------------------"
PRINT "Total scores is:"; S
PRINT "The average score is:"; S / 10
PRINT "---------------------------"
OPTION BASE 1
DIM a(12),S
PRINT
PRINT ""
FOR i = 1 TO 12
PRINT "No"; i
INPUT "Please input the score from umpire:",a(i)
PRINT "--------------------------------------"
NEXT i
PRINT
PRINT "Now,display the scores from all umpires:"
PRINT
FOR j = 1 TO 12
PRINT a(j);
NEXT j
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "Now,reorder these scores:"
PRINT
FOR m = 1 TO 11
FOR n = m + 1 TO 12
IF a(m) > a(n) THEN SWAP a(m),a(n)
NEXT n
NEXT m
FOR k = 1 TO 12
PRINT a(k);
NEXT k
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "Now,delete the maximal and the minimal scores:"
PRINT
S = 0
FOR t = 2 TO 11
PRINT a(t);
S = S + a(t)
NEXT t
PRINT "-------------------------------------------------------------------------------"
PRINT
PRINT "The result is:"
PRINT "---------------------------"
PRINT "Total scores is:"; S
PRINT "The average score is:"; S / 10
PRINT "---------------------------"