皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
【程序设计】 --------------------------------------------------------------------------- 题目:数组 score中存放N个学生的学号、三门课程及总成绩。总成绩进行降序 排序。 sc数组中存放5个同学总成绩,用折半查找法查找总成绩对应的同学( 假定所有同学的总成绩互不相同)。 程序运行的结果是: 原数组中元素为 : 1501 90 80 70 240 1520 99 87 89 275 1531 95 88 82 265 1503 92 85 79 256 处理后数组元素为 : 1520 99 87 89 275 1531 95 88 82 265 1503 92 85 79 256 1501 90 80 70 240 查找结果为 : 240分同学的名次为:4 275分同学的名次为:1 265分同学的名次为:2 256分同学的名次为:3 234分成绩没找到 编写程序: 1、编写void sort( int a[][M],int n)函数,依据a数组中n个同学的总成绩对a数组进 行降序排序。 2、编写int search( int a[][M],int n, int x)函数,用折半查找法在a数组中查找总 成绩为 x的同学的名次。找到,函数返回该同学的名次,没有找到,则返回-1。n为同 学的个数。 --------------------------------------------------------------------------- 注意:请勿改动主程序 main()中的任何语句。 ---------------------------------------------------------------------------*/ #include #include #include #define N 4 #define M 5 void sort( int a[][M],int n) { /**********Program**********/ /********** End **********/ } int search( int a[][M],int n, int x) { /**********Program**********/ /********** End **********/ } int main( ) { int score[][M]={{1501,90,80,70,240},{1520,99,87,89,275},{1531,95,88,82,265},{1503,92,85,79,256}}; int i,j,f,sc[5]={240,275,265,256,234}; FILE *fp; if((fp=fopen("DATA.TXT","w"))==NULL) { printf("文件打开错误\n"); exit(0); } printf("\n原数组中元素为:\n"); for(i=0;i
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】Please identify what type of evidence is used:Harold McConnel, who has been working with and designing railroad tracks for the past three decades, after examining the scene of the accident at the trai...
A.
Expert testimony
B.
Eyewitness testimony
C.
An anecdote
D.
Statistics
【单选题】信息素养的核心是
A.
信息知识
B.
信息意识
C.
信息道德
D.
信息能力
【单选题】Please identify what type of evidence is used:The scene was entirely out of control. I was standing only ten feet away from the President, who was walking through the crowds on the sidewalk of Jeffers...
A.
Statistics
B.
Analogy
C.
Eyewitness
D.
Textual evidence
【单选题】Please identify what type of evidence is used: Harold McConnel, who has been working with and designing railroad tracks for the past three decades, after examining the scene of the accident at the tra...
A.
Expert testimony
B.
Statistics
C.
An anecdote
D.
Eyewitness testimony
【单选题】信息素养的核心是
A.
信息意识
B.
信息知识
C.
信息能力
D.
信息意识
【单选题】信息素养的核心()
A.
信息意识
B.
信息知识
C.
信息能力
D.
信息道德
【单选题】Please identify what type of evidence is used. Choose one appropriate answer. The scene was entirely out of control. I was standing only ten feet away from the President, who was walking through the c...
A.
Statistics
B.
Analogy
C.
Eyewitness
D.
Textual evidence
【单选题】Please identify what type of evidence is used: The scene was entirely out of control. I was standing only ten feet away from the President, who was walking through the crowds on the sidewalk of Jeffer...
A.
Eyewitness
B.
Textual evidence
C.
Statistics
D.
Analogy
【单选题】Please identify what type of evidence is used. Choose one appropriate answer. According to the school’s policy, students with disability are exempted from the PE tests. Therefore, the attempt to make...
A.
Textual evidence
B.
Expert testimony
C.
Analogy
D.
Statistics
【简答题】数据交换有电路交换 、报文交换 和( )三种主要交换技术
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题