请问,为什么这个代码只能输入,没有输出
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
struct list{
int num;
char name[30];
double salary;
struct list*next;
};
struct list *create()
{
struct list *head;
struct list p;
struct list tail;
int n=0;
int num;
char name[30];
double salary;
//tail=p=(struct list)malloc(sizeof(struct list));
scanf("%d",&num);
while(num!=0){
n++;
scanf("%s\t%ld",name,&salary);
p=(struct list)malloc(sizeof(struct list));
p->num=num;p->salary=salary;strcpy(p->name,name);
p->next=NULL;
if(n==1)
head=p;
else
tail->next=p;
tail=p;
scanf("%d",&num);
}
return head;
}
int main()
{
printf("请输入职工信息:");
struct list *head=create();
void max_list(struct list *head);
max_list(head);
return 0;
}
void max_list(struct list *head)
{
struct list *z,q;
q=z=(struct list)malloc(sizeof(struct list));
z=head;
for(q=head;q->next!=NULL;q=q->next)
{
if(q->salary>z->salary)
{
z=q;
}
z->next=NULL;
}
printf("最高基本工资的员工信息:&s &ld",z->name,z->salary);
//return head;
}