#include
#include
#include
struct students{
int number;
char name[20];
int score;
struct students * next;
};
int main(void)
{
struct students * head , * tail , * p;
head = tail = NULL;
int num , score;
int number;
int size = sizeof(struct students);
char name[20];
scanf("%d" ,&num);
while(num != 0)
{
p = (struct students *) malloc (size);
scanf("%s%d", name , &score);
p -> number = num;
strcpy(p -> name , name);
p -> score = score;
p -> next = NULL;
if(head == NULL)
head = p;
else
tail -> next = p;
tail = p;
scanf("%d" ,&num);
}
scanf("%d", &number);
for(p = head; p ;p = p -> next)
{
if((p -> score) >= number)
printf("%d\t%s\t%d\n", p -> number ,p -> name,p -> score);
}
return 0;
}
|