您好,欢迎访问三七文档
#ifndefuser_H//Óû§×Ô¶¨ÒåÍ·Îļþuser-defined#defineuser_H#includewindows.h//Ö§³ÖSleepº¯Êý#includestdio.h#includetime.h//ÓÃÓÚËæ»úº¯Êý³õʼ»¯time()voidcolor_back()//ÉèÖÃÎı¾×Ö·ûµÄÑÕÉ«{inti;srand((unsigned)time(NULL));//³õʼ»¯Ê±ÖÓi=rand()%15;//Ëæ»úÒ»¸ö0µ½14µÄÕûÊýswitch(i){case0:system(color07);break;case1:system(color08);break;case2:system(color09);break;case3:system(color0A);break;case4:system(color0B);break;case5:system(color0C);break;case6:system(color0D);break;case7:system(color0E);break;case8:system(color0F);break;case9:system(color01);break;case10:system(color02);break;case11:system(color03);break;case12:system(color04);break;case13:system(color05);break;case14:system(color06);break;}}voiddisplay_picture()//ÏÔʾ¶¯»³ÌÐò{system(cls);printf(\n);color_back();//Ëæ»úÒ»¸öÎı¾ÑÕÉ«Sleep(300);//ÈÃϵͳÔÝÍ£300ºÁÃëprintf(\n\n\n\n\n\t\t\t\t»¶);color_back();Sleep(300);printf(Ó);color_back();Sleep(300);printf(ʹ);color_back();Sleep(300);printf(ÓÃ);color_back();Sleep(300);printf(³¬);color_back();Sleep(300);printf(ÊÐ);color_back();Sleep(300);printf(¹Ü);color_back();Sleep(300);printf(Àí);color_back();Sleep(300);printf(ϵ);color_back();Sleep(300);printf(ͳ);color_back();}#endif#includewindows.h#includeiostream#includefstream#includeconio.h#includestring.h#includestring//Çø±ðstringºÍstring.h#includectime#includeuser.h#definen100#defineN1000usingnamespacestd;classGoods{protected:intnumber;stringtnum;stringsname;intnum;doublemoney;intmnum;intsnum;doubleprice;public:voidsetnumber(intx);voidsettnum(stringx);voidsetsname(stringx);voidsetnum(intnum);voidsetmnum(intx);voidsetsnum();voidsetprice(doublex);stringgettnum();voidgetprice();voidgetnum();voidgetmnum();voidgetname();voidgetsnum();doublegetmoney();intgetnumber();};Goodsprod[1000];intbianhao[200],geshu[20],x;fstreamfile;ofstreamfile1;HANDLEhout;COORDcoord;structmember{stringname;stringsex;intage;inta;stringID;stringaddress;}mem[1000];voidactive();voidyanzheng();voiddenglu();voidshow();voidchaxun2();voidchaxun3();voidchauxun5();voidempty1();voidempty2();voidbanli();voidtemp();voidshow4();voidxiugai();voidback();voidmenu();voidquit();voidGoods::setnum(intx){num=x;}voidGoods::setprice(doublex){price=x;}voidGoods::setsname(stringx){sname=x;}voidGoods::settnum(stringx){tnum=ISBN-+x;}voidGoods::setmnum(intx){mnum=x;}voidGoods::setsnum(){num=num-mnum;snum=num;}voidGoods::setnumber(intx){number=x;}voidGoods::getmnum(){coutmnum;}voidGoods::getname(){coutsname;}voidGoods::getprice(){coutprice;}intGoods::getnumber(){returnnumber;}stringGoods::gettnum(){returntnum;}voidGoods::getnum(){coutnum;}voidGoods::getsnum(){coutsnum;}doubleGoods::getmoney(){money=price*mnum;returnmoney;}voidyanzheng()//ÑéÖ¤ÂëµÄʵÏÖ{inti,p=0;charb;charrandpass[6];charrands[6];cout\n\n\t\t\tÄ㵱ǰµÇ¼Ëæ»úÑéÖ¤ÂëΪ:;srand((unsigned)time(NULL));for(i=0;i6;i++){if((rand()&1)==0){if(p2)randpass[p++]='0'+rand()%10;elserandpass[p++]='A'+rand()%26;}else{if(p2)randpass[p++]='0'+rand()%10;elserandpass[p++]='a'+rand()%26;}}randpass[i]=0;puts(randpass);cout\n\t\t\tÇëÊäÈëÄãµÄÑéÖ¤Âë:\n\t\t\t;gets(rands);strupr(rands);//Сдת»¯Îª´óдstrupr(randpass);//Сдת»¯Îª´óдif(strcmp(randpass,rands)==0){cout\n\n\t;for(i=0;i10;i++){Sleep(100);cout¡ô;}coutµÇ½³É¹¦!;for(i=0;i10;i++){Sleep(100);cout¡ô;}cout\n\n\t\t\tÊÇ·ñ½øÈë:yÊÇn·ñ....;fflush(stdin);cinb;if(b=='y'||b=='Y'){system(cls);menu();}elseif(b=='n')exit(0);}else{cout\t\t\tÑéÖ¤ÂëÊäÈë´íÎó!\n;Sleep(1000);system(cls);cout\n\n\t\t\tÊäÈë´íÎó!\n;Sleep(300);system(cls);cout\n\t\t\tÇëÑ¡Ôñ:1µÇ¼\n\n\t\t\t\t2×¢²á\n\n;}}voidactive()//×ÖÄ»¹ö¶¯{coord.X=0;coord.Y=7;do{hout=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hout,coord);cout^O^»¶Ó½øÈ볬ÊÐÊÕÒø¹ÜÀíϵͳ^O^;Sleep(50);coord.X++;if(coord.X==30)break;}while(1);}voiddenglu()//µÇ½½çÃæ{inti,j;charguanliyuan[12];charpasswords[10];charusers[12],users1[12];charpass[10],pass1[10];intcount=0;chara,c;active();system(cls);system(color0F);cout\t\t\tÎÂÜ°Ìáʾ:ÄãÓÐÈý´Î»ú»á!;Sleep(1000);system(cls);cout\n\n\n\t\t***************************************\n\t\t;for(i=0;i9;i++){Sleep(100);printf(//);}cout^O^;for(i=0;i9;i++){Sleep(100);printf(//);}cout\n\t\t***************************************\n;cout\t\t\t»¶Ó½øÈ볬ÊÐÊÕÒø¹ÜÀíϵͳ\n;cout\n\t\t\tÇëÑ¡Ôñ:1µÇ¼\n\n\t\t\t\t2×¢²á\n\n;do{printf(\t\t\t\t);a=getchar();system(cls);fflush(stdin);if(a=='1'){cout\n\n\t\t\tÓû§Ãû:;gets(guanliyuan);cout\n\n\t\t\tÃÜÂë:;i=0;while((c=getch())!=13){if(c==8){if(i==0)continue;putchar('\b');putchar('');putchar('\b');pass[--i]=0;continue;}printf(¡ñ);passwords[i++]=c;}passwords[i]=0;file.open(Óû§.txt,ios::in|ios::binary);if(!file.fail()){chars[15];//»»³Éstringºó»á±¨´íL1:files;//²»¶ÁÈë¿Õ¸ñstrcpy(users,s);files;strcpy(pass,s);//ÕâÀï²»ÄÜÖ±½Ó¸³Öµif(strcmp(guanliyuan,users)==0&&strcmp(passwords,pass)==0){file.close();yanzheng();break;}else{if(file.eof()){cout\n\n\t\t\tÊäÈë´íÎó!;gotoL2;}elsegotoL1;}}else{cout\n\n\t\t\tÊäÈë´íÎó!\n;Sleep(300);system(cls);cout\n\t\t\tÇëÑ¡Ôñ:1µÇ¼\n\n\t\t\t\t2×¢²á\n
本文标题:超市收银管理系统
链接地址:https://www.777doc.com/doc-1409784 .html