2022年C语言程序设计清华大学出版社习题7答案 .pdf
《2022年C语言程序设计清华大学出版社习题7答案 .pdf》由会员分享,可在线阅读,更多相关《2022年C语言程序设计清华大学出版社习题7答案 .pdf(6页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、习题7 答案一、程序阅读题1.D 2.D 3.B 4.1,0,0,1 5.a1e1 二、程序填空题1这个题目不合适,不考虑了2C A A B 3C D C 4A B 三、编程题1#include#define NUM 5 void main()int aNUM,i,n;float sum=0,aver;printf(Enter Student Scoresn);for(i=0;iNUM;i+)scanf(%d,&ai);sum=sum+ai;aver=sum/NUM;n=0;printf(高于平均分的成绩:);for(i=0;iaver)printf(%d,ai);n+;putchar(n);
2、printf(高于平均分数%f 的人数是:%dn,aver,n);2#include#define M 4#define N 3 void main()int i,j,kmax,kmin,scoresMN;int sumM,max,min;for(i=0;iM;i+)for(j=0;jN;j+)scanf(%d,&scoresij);for(i=0;iM;i+)sumi=0;for(j=1;jN;j+)sumi=sumi+scoresij;max=min=sum0;kmax=kmin=0;for(i=0;imax)max=sumi;kmax=scoresi0;if(sumimin)min=su
3、mi;kmin=scoresi0;printf(总分最高的学号=%d,总分=%dn,kmax,max);printf(总分最低的学号=%d,总分=%dn,kmin,min);3#include#include#define M 5#define N 100 void main()int aMM,sumrM=0,sumcM=0,sumd1=0,sumd2=0;int i,j;for(i=0;iM;i+)for(j=0;j M;j+)aij=rand()/N;printf(%15d,aij);sumri+=aij;sumcj+=aij;printf(n);sumd1+=aii;sumd2+=aiM
4、-i-1;printf(n);for(i=0;iM;i+)printf(sumrow%d=%d,i,sumri);printf(sumcol%d=%dn,i,sumci);printf(sumdia1=%d sumdia2=%dn,sumd1,sumd2);4#include 文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9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3H8O
8、3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2
9、Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3
10、D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H
11、8O3E4V6#include#define M 3 void findmax(int aM,int ln);void outdata(int aM,int ln);void main()int sMM=22,33,34,90,91,66,30,1,56,;int lnmM;/*存放每列最大值所在的行号*/findmax(s,lnm);outdata(s,lnm);void findmax(int aM,int ln)int i,j,t;for(i=0;iM;i+)t=0;for(j=1;jati)t=j;lni=t;void outdata(int aM,int ln)int i,j;for
12、(i=0;iM;i+)for(j=0;jM;j+)printf(%8d,aij);printf(n);printf(n max&line numbern);for(i=0;iM;i+)printf(%3d:%2dn,alnii,lni);printf(n);5参照例 7-14(2)6#define N 10#define M 10 void main()int i,j,k,m,n,flag1,flag2,aNM,max,maxj;printf(“n 输入行数 n:”);scanf(“%d”,&n);printf(“n 输入列数 m:”);scanf(“%d”,&m);for(i=0;i n;i
13、+)printf(“第%d 行?n”,i);for(j=0;jm;j+)scanf(“%d”,&aij);文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文
14、档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R
15、9A5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4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7
19、Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6 for(i=0;i n;i+)for(j=0;jm;j+)printf(“%5d”,aij);printf(“n”);flag2=0;for(i=0;i n
20、;i+)max=ai0;for(j=0;jmax)max=aij;maxj=j;for(k=0,flag1=1;kakmaxj)flag1=0;if(flag1)printf(“n 第%d 行,第%d 列的%d 是鞍点 n”,i,maxj,max);flag2=1;if(!flag2)printf(“n 矩阵中无鞍点!n”);7#include#define M 5#define N 3 void main()int i,j,t;int aM=4,5,6,7,8;for(j=1;j=1;i-)ai=ai-1;a0=t;for(i=0;iM;i+)printf(%d,ai);printf(n);
21、8#include#include#define SIZE 100 void arrsort(int,int);文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4V6文档编码:CG2Y9Y10R9A5 HB3D3S7Z8B6 ZJ3H8O3E4
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年C语言程序设计清华大学出版社习题7答案 2022 语言程序设计 清华大学出版社 习题 答案
限制150内