#include
#define FORMAT "%d\n%s\n%f\n%f\n%f\n"
struct student
{
int num;
char *name;
float score[3];
};
struct student stu;
void main()
{
void print(struct student *);
scanf("%d%s%f%f",&stu.num,stu.name,&stu.score[0],&stu.score[1]);
scanf("%f",&stu.score[2]);
print(&stu);
getch();
}
void print(struct student *p)
{
printf(FORMAT,p->num,p->name,p->score[0],p->score[1],p->score[2]);
printf("\n");
}
12345 lili 89 89 90
12345
89.000
89.000
90.000
#include
#define FORMAT "%d\n%s\n%f\n%f\n%f\n"
struct student
{
int num;
char name[20];
float score[3];
};
struct student stu;
void main()
{
void print(struct student *);
scanf("%d%s%f%f",&stu.num,stu.name,&stu.score[0],&stu.score[1]);
scanf("%f",&stu.score[2]);
print(&stu);
getch();
}
void print(struct student *p)
{
printf(FORMAT,p->num,p->name,p->score[0],p->score[1],p->score[2]);
printf("\n");
}
12345 lili 89 89 90
12345
lili
89.000
89.000
90.000
原因:
阅读(485) | 评论(0) | 转发(0) |