main.cpp

来自「个人爱好,自己编的小代码.仅供参考」· C++ 代码 · 共 61 行

CPP
61
字号
#include"globle.h"
#include"goods.h"
#include"deallog.h"
#include"consumer.h"
#include"admin.h"
#include"management.h"

ofstream   outGoods("goodsStack.txt",ios::out|ios::app);
ofstream   outConsumer("consumerStack.txt",ios::out|ios::app);
ofstream   outDealLog("DealLogStack.txt",ios::out|ios::app);
int main()
{
   cout<<"为方便管理,我们只设定了一名管理员,而且密码是设定好的,123123.\n\n";
   GoodsManagementSystem  gm;
   char pswd[10];
   vector<consumer> c;
   cout<<"超市管理系统为您服务!\n请选择方式登陆:\n"
	   <<"1。管理员登陆;2。消费者登陆;3。新会员注册。0。退出服务。\n";
   int choice;
   cin>>choice;
   while(choice)
   {
	   switch(choice)
	   {
	   case 1:
		   cout<<"请输入密码:";
		   cin>>pswd;
		   if(!strcmp(pswd,"123123"))
		       gm.AdminInterface();
		   else
			    cout<<"密码错误!";
		   break;
	   case 2:
		   int i;
           cout<<"1会员;2非会员。\n";
		   cin>>i;
		   if(i==1)
		       gm.memberInterface(c);
		   if(i==2)
			   gm.notMbInterface();
		   else
			   cout<<"输入有误!\n";
		   c.clear();
		   break;
	   case 3:
		   gm.registerInterface(c);
		   c.clear();
		   break;
	   case 0:
		   cout<<"谢谢您的使用,再见!";
	   default:
		   cout<<"您的输入有误!请重新输入。\n";
		   break;
	   }
	   cout<<"超市管理系统为您服务!\n请选择方式登陆:\n"
	       <<"1。管理员登陆;2。消费者登陆;3。新用户注册。0。退出服务。\n";
	   cin>>choice;
   }
   return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?