C语言temp有什么用
#include<stdio.h>#defineMAX100structstudent{charname[10];intstu_id;intgrade;}stu[MAX]...
#include<stdio.h>
#defineMAX 100
structstudent
{char name[10];
intstu_id;
intgrade;
}stu[MAX];
intmain()
{
inti;
structstudent temp;
for( i=0;i<MAX;i++)
{ gets(temp.name);
scanf("%d%d",&temp.stu_id,
&temp. grade);
stu[i]=temp;
getchar();
}
for( i=0;i<MAX;i++)
printf("%10s%4d%4d\n",stu[i].name,
stu[i].stu_id,stu[i].grade);
return 0;
}
temp有什么用啊,如果不用temp呢? 展开
#defineMAX 100
structstudent
{char name[10];
intstu_id;
intgrade;
}stu[MAX];
intmain()
{
inti;
structstudent temp;
for( i=0;i<MAX;i++)
{ gets(temp.name);
scanf("%d%d",&temp.stu_id,
&temp. grade);
stu[i]=temp;
getchar();
}
for( i=0;i<MAX;i++)
printf("%10s%4d%4d\n",stu[i].name,
stu[i].stu_id,stu[i].grade);
return 0;
}
temp有什么用啊,如果不用temp呢? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询