intsl;?};?structkca[5]= //定义书籍资料?{ {"c程序设计","谭浩强","清华大学出版社",,33.00,1,100}, {"高等数学","同济大学数学系","高等教育出版社",,29.40,2,100}, {"代码的未来","松本行弘","人民邮电出版社",,79.00,3,100}, {"51单片机入门开发扩展全攻略","电子工业出版社","郭天祥",,4,100}, {"51单片机典型应用开发范例大全","中国铁道出版社","郑锋",,79.00,5,100}, };flag1:?printf("请输入书名\n");?fflush(stdin);?gets(sm);?j=0; //未找到书籍而跳到这里时使j清零,防止当再次没找到书籍时因j已大于5而无法进入最后的if语句,即无法得到未查找到的提示?for(i=0;i<5;i++)?{ j++; //当j加到5时则说明没有找到书籍 if(cmp(a[i].sm,sm)==0) { printf("书名"); puts(a[i].sm); printf("作者"); puts(a[i].zz); printf("出版社"); puts(a[i].cbs); printf("出版日期%d\n",a[i].cbrq); printf("价格%lf\n",a[i].jg); printf("位置%d\n",a[i].wz); printf("库存%d\n",a[i].sl); printf("请输入所需数量\n"); fflush(stdin); scanf("%d",&n); if(n<=a[i].sl) printf("总价为%lf\n",(n*a[i].jg)); else printf("所需数量不在库存范围内\n"); printf("是否还想买其他书籍?(是Y或y否双击回车键)\n");