fp=fopen("chaoshi.txt","wt");Р for(i=1;i<=(k-1);i++)Р fwrite(&sp[i],sizeof(struct goods),1,fp);Р fclose(fp);Р printf(" 是否继续,是(1),否(0)\n\t\t\t");Р scanf("%d",&flag);Р?}while(flag!=0);Р?chakan();Р}Рshijian()Р{Р?struct tm when;Р?time_t now;Р?time(&now);Р?when=*localtime(&now);Р?printf(" %s\n",asctime(&when));Р}Рmain()//主函数Р{Р?int choice;Р?doР?{Р printf("\n\n\n ********超市管理系统*******\n\n");Р printf(" 1.进货\n");Р printf(" 2.销售\n");Р printf(" 3.增加商品数量\n");Р printf(" 4.删除商品\n");Р printf(" 5.查看目前库存\n");Р printf(" 0.返回主菜单\n");Р printf(" 请选择您要进行地操作\n\t\t\t");Р scanf("%d",&choice); Р switch(choice)Р {Р case 1:jinhuo();break;Р case 2:xiaoshou();break;Р case 3:zengjia();break;Р case 4:shanchu();break;Р case 5:chakan();break;Р case 0:break;Р default :printf(" 输入有误,请重新输入\n\t\t\t");Р }Р?}while(choice!=0);Р}