From b2a9c6649fa25fb4075535122eb63ca2d3ad5388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E6=99=A8?= <396312472@qq.com> Date: Sat, 12 Jan 2019 20:39:24 +0800 Subject: [PATCH] first commit --- 计算机大类1807班18408000733冯晨.cpp | 111 ++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 计算机大类1807班18408000733冯晨.cpp diff --git a/计算机大类1807班18408000733冯晨.cpp b/计算机大类1807班18408000733冯晨.cpp new file mode 100644 index 0000000..cb57833 --- /dev/null +++ b/计算机大类1807班18408000733冯晨.cpp @@ -0,0 +1,111 @@ +#include +#include +#include + + int cmp(char str0[],char str1[]) //ȽַǷȣ򷵻0򷵻ط0 +{ + int i; + for(i=0;str0[i]!=0 && str1[i]!=0 && str0[i]==str1[i];i++); + return str0[i]-str1[i]; +} + int main(void) +{ + char sm[100]; + + int c=1,i=0,n=0,flag=0,j=0; + struct kc //ṹ飬ÿʵĸȡԱ硱Ϊsm +{ + char sm[100]; + char zz[100]; + char cbs[100]; + long cbrq; + double jg; + int wz; + int sl; +}; + struct kc a[10]= +{ //鼮 + {"ԹŮ","Ű","ʮճ",20090520,29.80,1,100}, + {"Χ","Ǯ","ѧ",19910214,19.00,2,10}, + {"¥","ѩ","ѧ",19961225,59.70,3,100}, + {"","","ʦѧ",20131001,39.80,4,100}, + {"һֻе","С","ճ",20060927,18.80,5,50}, + {"","ϸ","ѧ",20171116,39.00,6,60}, + {"˹ֵ","","ʮճ",19880707,32.00,7,80}, + {"ҵǰ","","",20070504,22.00,8,100}, + {"Ųɭ","ϴ","Ϻij",20010807,18.80,9,6}, + {"","","֪",20031101,18.80,10,20} + }; + flag1: + printf("***********ϵͳ***********:\n"); + printf("**** 1.鱾¼ ****:\n"); + printf("**** 2.鱾ѯ ****:\n"); + printf("**************************************:\n"); + + int choose; + printf("ѡ:\t"); + scanf("%d",&choose); //ѡ + + + if(choose==1) + { + printf("¼ɹ"); + } + + + if(choose==2){ + printf(":\n"); + fflush(stdin); + gets(sm); + j=0; //δҵ鼮ʱʹj㣬ֹٴûҵ鼮ʱjѴ10޷if䣬޷õδҵʾ + for(i=0;i<10;i++) + { + j++; //jӵ10ʱ˵ûҵ鼮 + 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("Ƿ鼮?( 1: 0:˫س)\n"); + fflush(stdin); + scanf("%d",&c); + if(c==1) + goto flag1; + else + { + j=0; //Ҫ˳ʱʹj㣬ֹ鼮λΪ10ʱforjҲΪ10if + printf("лл,ټ!\n"); + } +} +} + if(j=10) +{ + j=0; + printf("δҵ鼮Ƿ鼮YyNn)\n"); + fflush(stdin); //뻺棬ֹ´ + scanf("%c",&c); + if(c==1) + goto flag1; + else +{ + printf("ллټ!\n"); +} +} + return 0; +} +} +