C++程序设计教程第3版习题08参考答案.docxVIP

  • 0
  • 0
  • 约7.06千字
  • 约 11页
  • 2026-03-23 发布于湖南
  • 举报

C++程序设计教程第3版习题08参考答案.docx

习题08参考答案

1.参考答案:

#includeiostream

#includeiomanip

#includecstring

usingnamespacestd;

#defineN4

structstudent

{

charnum[10];

charname[20];

intsc;

};

intmain()

{

voidInput(studentstuds[],intn);

voidOutput(studentstuds[],intn);

intMax(studentstuds[],intn);

inti;

studentstuds[N];

Input(studs,N);

i=Max(studs,N);

Output(studs,N);

cout最高分学生的学生信息为:endl;

coutsetw(10)studs[i].numsetw(10);

coutstuds[i].namesetw(10);

coutstuds[i].scsetw(10)endl;

return0;

}

voidInput(studentstuds[],intn)

{

inti;

for(i=0;in;i++)

{

cout请输入第i+1个学生的学号:;

cinstuds[i].num;

cout

文档评论(0)

1亿VIP精品文档

相关文档