- 用户名:shuai97
- 通行证:477205
-
级别:勇士 日志:9篇 人气:3469 状态:
离线
|
cls input ndim xm$(n) max=0 for i=1 to n input d input j input x zongfen=d*0.2+j*0.3+x*0.5 if zongfen>max then max=zongfen max1=i end if next i print xm$(maxi) end 输入样例 3 孙沁馨 300 400 500 王显之 600 300 800 王嘉鑫 300 400 200 输出样例 王显之 |
|
cls 清屏 input n 输入一个人数 he=0 累加问题初始化为"0" dim a(n) 定义一个数组 a(n) for i=1 to n 循环 input a(i) 把成绩输入到a(i) he=he+a(i) he=he+成绩 next i 结束循环 pj=he/n 平均=总数/份数 cs=0 cs=0 for i=1 to n 循环 if a(i)>pj then cs=cs+1 如果成绩〉平均那么cs=cs+1 next i 结束循环 pritn pj 打印 平均 print cs 打印高于平均分的人数 end 结束程序 注:只能在qbasic 下使用 |