11. 题目描述
It is said that 90% of frosh expect to be above average in their class. You are to provide a reality check.
输入
The first line of standard input contains an integer C, the number of test cases. C data sets follow. Each data set begins with an integer, N, the number of people in the class (1 <= N <= 1000). N integers follow, separated by spaces or newlines, each giving the final grade (an integer between 0 and 100) of a student in the class.
输出
For each case you are to output a line giving the percentage of students whose grade is above average, rounded to 3 decimal places.
样例输入
5
5 50 50 70 80 100
7 100 95 90 80 70 60 50
3 70 90 80
3 70 90 81
9 100 99 98 97 96 95 94 93 91
样例输出
40.000%
57.143%
33.333%
66.667%
55.556%
12.设有一数列,包含10 个数,已按升序排好。现要求编一程序,它能够把从指定位置开始的n个数按逆序重新排列并输出新的完整数列。进行逆序处理时要求使用指针方法。(例如:原数列为2,4,6,8,10,12,14,16,18,20,若要求把从第4个数开始的5个数按逆序重新排列,则得到新数列为2,4,6,16,14,12,10,8,18,20。)
13.编写一个函数print,输出一个学生的成绩数组,该数组中有5个学生的数据记录,每个记录包括num、name、score[3],并编写input函数用来输入数据记录,在主函数中输出这些记录。
C语言程序考试,请高手帮忙!
答案:2 悬赏:20
解决时间 2021-04-07 16:51
- 提问者网友:浪女天生ˇ性情薄
- 2021-04-07 08:13
最佳答案
- 二级知识专家网友:哭不代表软弱
- 2021-04-07 08:50
分段截取,如4以前的存在一边,4及以后的存在另一边并排序,最后输出
全部回答
- 1楼网友:陪我到地狱流浪
- 2021-04-07 09:35
这是考的运算符优先级,你把书拿来看看,优先级高的先算
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯