【正文】
二.本程序雖然簡(jiǎn)短,但可以簡(jiǎn)單地運(yùn)用到花店的經(jīng)營(yíng)管理中,通過(guò)這個(gè)操作,讓花店經(jīng)營(yíng)得有條理,方便了顧客,也方便了自己。 } break。iSIZE。color)。 case 2: /*按顏色查詢(xún)*/ printf(In put a flower color:\n)。i++) { if(flower[i].rate==rate) printf(%s\t%d\t%f\t%d\n,flower[i].name,flower[i].color,flower[i].rate,flower[i].amount)。 for(i=0。 scanf(%f,amp。 } break。iSIZE。 scanf(%s,name)。rcmd)。/*輸出查詢(xún)的方式*/ printf(0find as name\t 1find as rate \t 2find as color\n)。 COLOR color。 char name[20]。 /*找到,剩余數(shù)量夠,可以買(mǎi)花,并計(jì)算總價(jià)格*/ } return price。 } else { flower[i].amount=flower[i].amountamount。 } else if(flower[i].amountamount)/*所購(gòu)花數(shù)量不夠*/ { printf(\nAmount not enought\n)。 } if(i==SIZE) { printf(\nNot fount the flower you buy\n)。amp。amp。iSIZE。amount)。 } printf(Please amount you want to buy:\n)。color=4) flag=0。 if(color=0amp。 scanf(%d,amp。 while(flag) /*客戶購(gòu)買(mǎi)花的情況*/ { printf(0red\t1white\t2yellow\t3purple\t4orante\n)。rate)。 printf(\nPlease enter name and rate you want to buy:\n)。 float rate,price。 char name[20]。 } printf(%%10d\n,flower[i].rate,flower[i].amount)。 case orange: printf(%8s,orange)。 case purple: printf(%8s,purple)。 case yellow: printf(%8s,yellow)。 case white: printf(%8s,white)。 switch(flower[i].color) { case red: printf(%8s,red)。iSIZE。