69,371
社区成员
发帖
与我相关
我的任务
分享
system("pause");
并且在源文件的起始位置处添加
#include <stdlib.h>
void inputstu(struct student stu[])
{
int i, j;
for (i = 0; i<N; i++)
{
printf("\n please input %d of %d\n", i + 1, N);
printf("num:");
scanf_s("%s", stu[i].num, 6);
printf("name:");
scanf_s("%s", stu[i].name, 8);
for (j = 0; j<3; j++)
{
printf("score %d", j + 1);
scanf_s("%d", &stu[i].score[j]);
}
printf("\n");
}
}
void printstu(struct student stu[])
{
int i, j;
printf("\nNo.Name Sco1 Sco2 Sco3\n");
for (i = 0; i<N; i++)
{
printf("%3s%5s", stu[i].num, stu[i].name);
for (j = 0; j<3; j++)
printf("%-4d", stu[i].score[j]);
printf("\n");
}
}