《精通C程序设计教程》第十十一章部分习题答案.docVIP

  • 5
  • 0
  • 约7.4千字
  • 约 8页
  • 2015-09-07 发布于重庆
  • 举报

《精通C程序设计教程》第十十一章部分习题答案.doc

《精通C程序设计教程》第十十一章部分习题答案.doc

《精通C程序设计教程》第十、十一章部分习题答案 第十章 10.2 read=0, green=1, yellow=5, white=6, black=7 10.6 42, 1 10.8 #include stdio.h typedef struct student { long xh;char xm[21];int s1,s2,s3; } STU; #define N 5 void inp_stu(STU a[N]) { int i; printf(Input %d students data\n,N); printf(xh xm s1 s2 s3\n); for(i=0;iN;i++) scanf(%ld%s%d%d%d,a[i].xh,a[i].xm,a[i].s1,a[i].s2,a[i].s3); } void out_stu(STU a[N],int p[N]) { int i; for(i=0;iN;i++) printf(%ld %s %d %d %d\n, \ a[p[i]].xh,a[p[i]].xm,a[p[i]].s1,a[p[i]].s2,a[p[i]].s3); } #define SUM(a,i) (a[i].s1+a[i].s2+a[i].s3) void Sort(STU a[N],int p[N]) /* 索引冒泡排序 */ {

文档评论(0)

1亿VIP精品文档

相关文档