第1个回答 2012-04-13
#include<stdio.h>
struct student
{
int stuNo;
char stuName[10];
float grade;
};
int main()
{
student stu[10];
int i;
printf("please input 10 student information:\n");
for(i=0;i<10;i++)
{
printf("the number %d:\n",i+1);
printf("name:");
scanf("%s",&stu[i].stuName);
printf("stuNo:");
scanf("%d",&stu[i].stuNo);
printf("Grade:");
scanf("%f",&stu[i].grade);
}
for(i=0;i<10;i++)
{
if(stu[i].grade<60)
printf("\nName:%s\nstuNo:%d\nGrade:%f",stu[i].stuName,stu[i].stuNo,stu[i].grade);
}
return 0;
}