commit 9bd5dc54f43246161e03d498d386880a34b60fd8 Author: chenjian <1747397884@qq.com> Date: Fri Jan 4 22:38:48 2019 +0800 first commit diff --git a/书店存货清单.cpp b/书店存货清单.cpp new file mode 100644 index 0000000..1f05bd2 --- /dev/null +++ b/书店存货清单.cpp @@ -0,0 +1,88 @@ +#include +#include +int main() +{ + printf("\t\t\t\t* * * <嵥> * * *\t\t\t\n"); + printf("\n"); + char name[100],c,b[3]={0,0,0}; + int i,n=0,j,k; + struct qd + { + char name[100]; // + char author[100]; // + char cbs[100]; // + long cbrq; // + double price; // + int wz; //ͼλãţ + int sl; // + }; + + struct qd a[3]= //ͼĿ¼ + { + {"C","̷ǿ","廪ѧ",20100604,33.00,1,99}, + {"ߵѧ","ͬôѧѧϵ","ߵȽ",20070606,29.40,2,99}, + {"Javaֲ","ڱ","ӹҵ",20180101,28.40,3,99}, + }; + + loop: printf("\n"); //ʼ + fflush(stdin); // + gets(name); + j=0; + for(i=0;i<3;i++) + { + j++; + if(strcmp(a[i].name,name)==0) //жûѡ鼮 + { + printf(":"); + puts(a[i].name); + printf(":"); + puts(a[i].author); + printf(":"); + puts(a[i].cbs); + printf(":%d\n",a[i].cbrq); + printf("۸:%lf\n",a[i].price); + printf("λ:%d\n",a[i].wz); + printf(":%d\n",(a[i].sl-b[i])); + + k=a[i].sl-b[i]; //¿ + + printf("\n"); + fflush(stdin); + scanf("%d",&n); + + b[i]=b[i]+n; //¿ + + if(n<=k) + printf("ܼ۸Ϊ%f\n\n",(n*a[i].price)); + else + printf("ڿ淶Χڡ\n"); + + printf("Ƿ鼮\n"); + printf("ǡ Yy\n 򵥻 س\n"); + fflush(stdin); + scanf("%c",&c); + if(c=='y'||c=='Y') + goto loop; //ؿʼι + else + { + j=0; + printf("*****ллټ*****\n"); + } + } + } + if(j==3) //δҵĿ鼮 + { + i=0; + printf("δҵ鼮Ƿ鼮\n"); + printf("ǡ Yy\n 򵥻 س"); + fflush(stdin); + scanf("%c",&c); + if(c=='y'||c=='Y') + goto loop; //ؿʼ + else + { + printf("*****ллټ*****\n"); + } + } + return 0; // +} diff --git a/书店存货清单.exe b/书店存货清单.exe new file mode 100644 index 0000000..82b8d5d Binary files /dev/null and b/书店存货清单.exe differ