#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
#include<string.h>
typedef struct date {
int year, month, day;
void input_date(){ scanf("%d-%d-%d",&year,&month,&day); }
void show_date() { printf("%d-%d-%d",year,month,day); }
}date;
typedef struct product {
char product_name[50];
int total, sales;
date in_date, out_date;
product* next_product;
}product, *List_product;
typedef struct kind {
char kind_name[50];
kind* next_kind;
List_product head;
}kind, *List_kind;
bool Find_kind(List_kind Q, char* name) {
kind* pk=Q->next_kind;
while(pk!=NULL) {
if(strcmp(pk->kind_name, name)==0) return true;
pk=pk->next_kind;
}
return false;
}
bool Find_product(List_kind Q, char* name) {
kind* pk=Q->next_kind;
while(pk!=NULL) {
product* pp=pk->head;
while(pp!=NULL) {
if(strcmp(pp->product_name, name)==0) return true;
pp=pp->next_product;
}
pk=pk->next_kind;
}
评论8