# 寄包柜问题C语言实现错误
```c
# include <stdio.h>
# include <stdlib.h>
typedef struct Node *In;
typedef struct Node{
int n;
int m;
int k;
int q;
In Next;
};
typedef In List;
List ReadPoly();
void Attach(int n,int m,int k,int q,In *Prear);
void PrintSearch(In Prear);
int main()
{
List com;
com = ReadPoly();
PrintSearch(com);
return 0;
}
List ReadPoly()
{
int total, read;
int n,m,k,q;
scanf("%d %d",&total,&read);
List front,rear,temp;
front = (List)malloc(sizeof(struct Node));
front-> Next = NULL;
rear = front;
for(int i=0;i<read;i++)
{
scanf("%d %d %d %d",&n,&m,&k,&q);
if(m<total)
{
Attach(n,m,k,q,&rear);
}
}
temp = front;
front = front->Next;
free(temp);
return front;
}
void Attach(int n,int m,int k,int q,In *Prear)
{
List p;
p = (List)malloc(sizeof(struct Node));
p->n = n;
p->m = m;
p->k = k;
p->q = q;
(*Prear)->Next= p;
(*Prear) = p;
}
void PrintSearch(List Prear)
{
int result;
List p;
p = Prear;
while(p)
{
if(p->n == 2)
{
result = p->q;
printf("%d\n",result);
}
}
}