您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 人事档案/员工关系 > 超市管理系统C语言程序代码
#include<stdio.h>#include<string.h>structarraysGoods{intgoods_id;//ÉÌÆ·±àºÅchargoods_name[50];//ÉÌÆ·Ãû³Æchargoods_address[50];//ÉÌÆ·²úµØchargoods_type[50];//ÉÌÆ·ÖÖÀàfloatgoods_inputprice;//ÉÌÆ·½ø¼Ûfloatgoods_outputprice;//ÉÌÆ·ÊÛ¼Ûintgoods_num;//ÉÌÆ·½ø»õÁ¿};structarraysGoodsGoodsDates[50]={{2013,"³ÄÉÀ","±±¾©","c",1.4,2.5,5},{2012,"¿ã×Ó","ÉϺ£","b",1.3,2.5,6},{2011,"¶ÌÐä","´óÁ¬","a",1.1,2.5,7}};structarraysGoodsGoodsDates2[50];voidloginTitle();voidloginManager();voidselectManagerMenu();voidspendPassager();voidspendPassagerMenu();inttuichuMenu();voidinsertGoods();voidprintManagerGoods();voidprintspendGoods();voiddeleteGoods();voidgenxinGoods();voidaddGoods();voidtongjiMenu();voidchaxunmol();voidpaixumol();voidlirunpai();voidkucunpai();voidshuliangMenu();voidxiugaiGoods();voidthetype();voidgoods_num();voidgoods_type();voidgoods_name();voidspendpaixumol();voidspendchaxunmol();voidspendlirunpai();voidspendkucunpai();voidspendgoods_num();voidspendgoods_type();voidspendgoods_name();voidmain(){loginTitle();//µ÷ÓõǼ½çÃæ}/*µÇ¼½çÃæ*/voidloginTitle(){intnumOperator;//²Ù×÷±àºÅintflag1=1;//Ñ»·±ê־λ/*Ñ»·µÇ¼½çÃæ*//*½øÈëϵͳÖ÷½çÃæ*/printf("\n\n\n");printf("***************************************\n");printf("*****************************************\n");printf("***********\n");printf("***********\n");printf("***********\n");printf("**********\n");printf("**************\n");printf("*****************************************\n");printf("***************************************\n");printf("\n\n");printf("\t\t»¶ÓʹÓÃSM³¬ÊÐÉÌÆ·¹ÜÀíϵͳ£¡(*^__^*)\n");printf("\n");do{printf("\t\t\t\t1.¹ÜÀíÕßϵͳ\n\t\t\t\t2.Ïû·ÑÕßϵͳ\n\t\t\t\t3.Í˳öϵͳ\n");printf("\n\t\t\tÇëÊäÈëÏàÓ¦²Ù×÷±àºÅ:");scanf("%d",&numOperator);/*µÚÈý²½£ºÅжÏÑ¡ÔñµÇ¼½çÃæ*/switch(numOperator){case1:printf("\n********************************************************************************");printf("\t\t\t¡¶»¶Ó½øÈë¹ÜÀíÕßϵͳ£¡¡·\n");loginManager();break;case2:printf("\n********************************************************************************");printf("\t\t\t¡¶»¶Ó½øÈëÏû·ÑÕßϵͳ£¡¡·\n");spendPassager();break;case3:tuichuMenu();flag1=0;break;default:printf("\n\t\t\t>>>ÊäÈë²Ù×÷±àºÅÎÞЧ£¬ÇëÖØÐÂÊäÈ룡<<<\n\n");}/*µÚËIJ½£ºÅжÏÊÇ·ñÍ˳öϵͳ£¬Èç¹ûΪÕ棬Í˳ö*/if(flag1==0){break;}}while(flag1);}/*Í˳öϵͳ½çÃæ*/inttuichuMenu(){intflag;printf("\t\t***************************************\n");printf("\t\t***¸ÐлÄú±¾´ÎµÄʹÓã¬ÔÙ¼û£¡O(¡É_¡É)O***\n");printf("\t\t***************************************\n");flag=0;returnflag;}/*¹ÜÀíÕßϵͳÃÜÂë¹ÜÀí½çÃæ*/voidloginManager(){charstrname[20];//ÊäÈëµÄÓû§Ãûcharstroldname[20]="1";//ÔÓû§Ãûcharstrpassword[20];//ÊäÈëµÄÃÜÂëcharstroldpassword[20]="1";//ÔÃÜÂë/*µÚÒ»²½£º»ñÈ¡Óû§Ãû*/printf("\t\t\t\tÇëÊäÈëÓû§Ãû:");scanf("%s",&strname);/*µÚ¶þ²½£º»ñÈ¡ÃÜÂë*/printf("\t\t\t\tÇëÊäÈëÃÜÂë:");scanf("%s",&strpassword);/*µÚÈý²½£º±È¶ÔÓû§Ãû£¬ÃÜÂëÊÇ·ñÕýÈ·£¬Èç¹û·µ»ØֵΪ0£¬ÏàµÈ£¬µÇ¼³É¹¦¡£·ñÔòµÇ¼ʧ°Ü£¬·µ»ØµÇ¼½çÃæ*/if((strcmp(strname,stroldname)==0)&&(strcmp(strpassword,stroldpassword)==0)){/*µÚËIJ½£ºµ÷ÓùÜÀíÕßϵͳ²Ëµ¥½çÃæ*/printf("\n\t\t\t\t>>>µÇ¼³É¹¦£¡<<<\n\n");selectManagerMenu();}else{/*µÚËIJ½£ºµ÷ÓõǼ½çÃæ*/printf("\n\t\t\t\t>>>µÇ¼ʧ°Ü£¡ÇëÖØеǼ£¡<<<");loginTitle();}}/*¹ÜÀíÕßϵͳ²Ëµ¥½çÃæ*/voidselectManagerMenu(){intnumOperator;//²Ù×÷±àºÅintflag=1;//Ñ»·±ê־λ/*Ñ»·µÇ¼½çÃæ*/do{/*µÚÒ»²½£ºÊä³ö²Ëµ¥±êÌâ*/printf("\t\t\t\t1.¼ÈëÐÅÏ¢\n\t\t\t\t2.Êä³öÐÅÏ¢\n\t\t\t\t3.¸üÐÂÄ£¿é\n\t\t\t\t4.ͳ¼ÆÄ£¿é\n\t\t\t\t5.ÅÅÐòÄ£¿é\n\t\t\t\t6.²éѯģ¿é\n\t\t\t\t7.Í˳öϵͳ\n");/*µÚ¶þ²½£º»ñÈ¡²Ù×÷±àºÅ*/printf("\t\t\t\tÇëÊäÈë²Ù×÷±àºÅ:");scanf("%d",&numOperator);/*µÚÈý²½£ºÅжÏÑ¡Ôñ²Ëµ¥*/switch(numOperator){case1:printf("\n\t\t\t\t¡¶Çë¼ÈëÉÌÆ·ÐÅÏ¢¡·\n");insertGoods();break;case2:printf("\n\t\t\t\t¡¶Êä³öÉÌÆ·ÐÅÏ¢¡·\n\n");printManagerGoods();break;case3:printf("\n\t\t\t\t¡¶½øÈë¸üÐÂÄ£¿é¡·\n\n");genxinGoods();break;case4:printf("\n\t\t\t\t¡¶½øÈëͳ¼ÆÄ£¿é¡·\n\n");tongjiMenu();break;case5:printf("\n\t\t\t\t¡¶½øÈëÅÅÐòÄ£¿é¡·\n\n");paixumol();break;case6:printf("\n\t\t\t\t¡¶½øÈë²éѯģ¿é¡·\n\n");chaxunmol();break;case7:tuichuMenu();flag=0;break;default:printf("\n\t\t\t>>>ÊäÈë²Ù×÷±àºÅÎÞЧ£¬ÇëÖØÐÂÊäÈ룡<<<\n\n");}if(flag==0){break;}}while(flag);}/*Ïû·ÑÕßϵͳÃÜÂë¹ÜÀí½çÃæ*/voidspendPassager(){charstrname[20];//ÊäÈëµÄÓû§Ãûcharstroldname[20]="2";//ÔÓû§Ãûcharstrpassword[20];//ÊäÈëµÄÃÜÂëcharstroldpassword[20]="2";//ÔÃÜÂë/*µÚÒ»²½£º»ñÈ¡Óû§Ãû*/printf("\t\t\t\tÇëÊäÈëÓû§Ãû:&
本文标题:超市管理系统C语言程序代码
链接地址:https://www.777doc.com/doc-4579960 .html