皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
学生的记录由学号和成绩组成,N名学生的数据已存放在主函数的结构体数组s中,请编写函数fun,它的功能是:把低于平均分的学生数据放在b所指的数组中,低于平均分的学生人数通过形参n传回,平均分通过函数值返回。 [注意] 部分源程序给出如下。 请勿改动主函数main和其他函数中的任何内容,仅在fun函数的花括号中填入所编写的若干语句。 [试题源程序] include<stdio.h> define N 8 typedef struct { char num[10]; double s; }STREC; double fun(STREC *a, STREC *b, int *n) { } void main() { STREC s[N]={{'GA05', 85}, {'GA03', 76}, {'GA02', 69}, {'GA04', 85}, {'GA01', 91}, {'GA07', 72}, {'GA08', 64}, {'GA06', 87}}; STREC h[N], t; FILE *out; int i, j, n; double ave; ave=fun(s, h, &n); printf('The %d student data which is lower than %7.3 f:/n', n, ave); for(i=0; i<n; i++) printf('%s %4.1f/n', h[i]. num, h[i].s); printf('/n'); ut=fopen('out.dat', 'W'); fprintf(out, '%d/n%7.3f/n', n, ave); for(i=0; 2<n-1; i++) for(j=i+1; j<n; j++) if(h[i]. s>h[j].s) { t=h[i]; h[i]=h[j]; h[j]=t; } for(i=0; 2<n; i++) fprintf(out, '%4.1f/n', h[i].s); fclose(out); }
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】在《绕圈的囚徒》这幅画中,梵高描绘了自己曾经作为精神病人被监禁的一段经历。1890年2月10日到11日,他根据法国插画画家( )版画的构图,临摹并涂抹色彩再创作的作品。
A.
米勒
B.
古斯塔夫多雷
C.
高更
D.
维米尔
【单选题】为使酒店开发更为科学合理,下列哪个公司应尽早参入酒店项目的规划及建设( )
A.
酒店咨询及管理公司
B.
建筑设计公司
C.
内装设计公司
D.
强弱电公司
【单选题】Which of the following allows the transmission of voice and often video communication over the Internet?
A.
Faxing
B.
Cell phones
C.
PDAs
D.
Voice over IP
【判断题】Prejudice and discrimination often occur in interethnic communication.
A.
正确
B.
错误
【判断题】用倒顺开关控制电动机的正反转时,可以直接把手柄由“顺”扳至“倒”的位置,使电动机反转。
A.
正确
B.
错误
【单选题】为使酒店开发更为科学合理,下列哪个公司应尽早介入酒店项目的规划及建设( )
A.
酒店咨询及管理公司
B.
建筑设计公司
C.
内装设计公司
D.
强弱电公司
【简答题】CO 2 的临界温度为31℃,临界压强为73×10 5 Pa,求1molCO 2 的临界体积.
【判断题】Employees often find interaction and communication with and attention from senior and executive managers motivational.()
A.
正确
B.
错误
【单选题】---We’re organizing a party next Saturday, and I’d like you to come. ---_____! I have a meeting to attend that day. Thank you all the same.
A.
Good luck
B.
What a pity
C.
Never do it again
D.
Well done
【单选题】This will be a great boost to the economy.
A.
improvement
B.
contribution
C.
support
D.
encouragement
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题