⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11.3.c

📁 谭浩强的C语言书里的部分作业
💻 C
字号:
#define FORMAT "%d,%s,%d,%d,%d"

struct student
{
int num;
char name[20];
int score[3];
}stu[5];


print(struct student stu)
{
printf(FORMAT,stu.num,stu.name,stu.score[0],stu.score[1],stu.score[2]);
printf("\n");
}


main()
{
int i,a,j;
for(i=0;i<5;i++)
{
a=i+1;
stu[i].num=a;
printf("Please put in the %d th student's name ",a);
scanf("%s",&stu[i].name);
printf("Please put in scores of the %d th student ",a);
for(j=0;j<3;j++)
scanf("%d",&stu[i].score[j]);
}
print(stu[0]);
print(stu[1]);
print(stu[2]);
print(stu[3]);
print(stu[4]);
getch();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -