链表
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct students{
int num;
char name[20];
int score;
struct students *next;
};
int main()
{
int num,score;
char name[20];
int size=sizeof(struct students);
struct students *head,*tail,*p;
head=tail=NULL;
scanf("%d%s%d",&num,name,&score);
while(num!=0){
p=(struct students*)malloc(size);
p->num=num;
strcpy(p->name,name);
p->score=score;
p->next=NULL;
if(head=NULL){
head=p;
}
else{
tail->next=p;
}
tail=p;
scanf("%d%s%d",&num,name,&score);
}
scanf("%d",&score);
struct students *ptr;
for(ptr=head;ptr!=NULL;ptr=ptr->next){
if(ptr->score>score){
printf("%d %s %d\n",&ptr->num,ptr->name,&ptr->score);
}
}
return 0;
}