书上例11.5,因为看不懂例题,所以根本就不知道错哪了 #include #define FORMAT"%d\n%s\n%f\n%f\n%f\n" struct student {int num; char name[20]; float score[3]; }; main() {void print(struct student); struct student stu; stu.num=12345; strc

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/14 02:39:01
书上例11.5,因为看不懂例题,所以根本就不知道错哪了 #include #define FORMAT
xS]K`+/!UM;v#bw1MgMC :-↝LPUYmE&Wq/nINs>a=6MG#`RFe<[yѲt!f+;95{u4&J|Q h,/DI@O?ϥ ܅BU0P!UѲI-)HJBr"Fb4 ҨĉC/b T׻`LeDr^ME%w[4fFؕ$Ţ`ͷL^۴W0?pM _na(HB%\fjIh2a|<`mk(  0+& )l+^U~#-b|޼h<`r;-,?ޞ&߭{5k/Ϧqz=>^spւجv ]X@{K~a{}QZH#ޠfq+2'e iX

书上例11.5,因为看不懂例题,所以根本就不知道错哪了 #include #define FORMAT"%d\n%s\n%f\n%f\n%f\n" struct student {int num; char name[20]; float score[3]; }; main() {void print(struct student); struct student stu; stu.num=12345; strc
书上例11.5,因为看不懂例题,所以根本就不知道错哪了
#include
#define FORMAT"%d\n%s\n%f\n%f\n%f\n"
struct student
{int num;
char name[20];
float score[3];
};
main()
{void print(struct student);
struct student stu;
stu.num=12345;
strcpy(stu.name,"li li");
stu.score[0]=67.5;
stu.score[1]=89;
stu.score[2]=78.6;
print(stu);
}
void print(struct student stu)
{print(FORMAT,stu.num,stu.name,stu.score[0],stu.score[1],stu.score[2]);
printf("\n");
getch();
}
再帮我看看错哪了?

书上例11.5,因为看不懂例题,所以根本就不知道错哪了 #include #define FORMAT"%d\n%s\n%f\n%f\n%f\n" struct student {int num; char name[20]; float score[3]; }; main() {void print(struct student); struct student stu; stu.num=12345; strc
void print(struct student stu)
{
printf(FORMAT,stu.num,stu.name,stu.score[0],stu.score[1],stu.score[2]);
printf("\n");
getch();
}
在函数的开始的那个“PRINT”应该为“PRINTF”就可以了.编程要有耐心,也要细心.为了强调,用了大写.