#include <stdio.h>
#include <stdlib.h>
struct node
{
int num;
char name[20];
int score;
struct node *next;
};
struct node *creatlist();
int main()
{
struct node *p,*head;
int temp_score;
head=creatlist();
printf("\n");
scanf("%d",&temp_score);
for(p=head;p!=NULL;p=p->next)
{
if(p->score>=temp_score);
{
printf("%d %s %d\n",p->num,p->name,p->score);
}
}
return 0;
}
struct node *creatlist()
{
struct node *p,*head;
head=(struct node *)malloc(sizeof(struct node)); //建立头结点
head->next=NULL; //将head->next置为空
while(1)
{
p=(struct node *)malloc(sizeof(struct node)); //建立p结点,分配内存空间
scanf("%d",&p->num);
if(p->num==0)
{
break;
}
else
{
scanf("%s%d",p->name,&p->score);
p->next=head->next;
head->next=p;
}
}
return head->next;
//输入学生个人信息结束,返回头指针
}