struct goods
{
int bianhao;
char pinming[20];
float jinjia;
float shoujia;
int jinhuoliang;
char changjia[20];
int cangku;
};
struct Node
{
struct goods data;
struct Node* next;
};
struct Node* head;
struct Node* create();
void input();
void addgoods();
void delgoods();
void changegoods();
void viewgoods();
void search();
//省略了一部分无关紧要的代码
void input()
{
FILE* fp;
struct goods SP;
char m;
printf("录入\n");
printf("请输入要录入商品信息\n");
printf("*************************\n");
fp = fopen("D:\\file1.dat", "wb");
if (fp == NULL)
{
printf("文件打开失败\n");
exit(0);
}
fclose(fp);
while (1)
{
printf("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n");
printf(" 请输入商品编号\n");
printf("┠━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┨\n");
scanf("%d", &SP.bianhao);
我想要在输入了重复商品编号的时候,程序能够提醒我,并让我重新输入