全文预览

C语言参考答案

上传者:读书之乐 |  格式:pdf  |  页数:60 |  大小:5169KB

文档介绍
r(int j=O;j<num-i-l;j++)\rif(strcmp(Stus[j].name,Stus[j+l].name)>O)\rSwapSudent(&Stus[j],&Stus[j+l]);\r)\rstruct Student inputStudent()\r{ struct Student tempstu;\rputs("Name:");\rgets(tempstu.name);\rputs("Phone:");\rgets(tempstu.phone);\rputs("Score:");\rscanf("%d",&tempstu.score);\rreturn tempstu;\r)\rvoid showdata(struct Student Stus[],int num)\r{ printf(HName\t Phone\t Score\t\n");\rfor(int i=0;i<num;i++)\rprintf("%s %s %8d \n",Stus[i].name,Stus[i].phone,Stus[i].score);\r)\rvoid insertStudent()\r{ struct Student Stus[6];\rStus[5]=inputStudent();.\rreadStudentArr(Stus,5);\rbubble(Stus,6);\rshowdata(Stus,6);\rwriteStudentArr(Stus,6);\r}\rint main(int argc, char* argv[])\r{ insertStudent();\rreturn 0;\r)

收藏

分享

举报
下载此文档