-
Notifications
You must be signed in to change notification settings - Fork 0
/
App1.cpp
50 lines (43 loc) · 896 Bytes
/
App1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// App1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// Logistics Management System
#include <iostream>
#include <string>
#include "Controller.h"
Controller* now;
int main()
{
std::string op, userName;
now = new Controller;
while (1)
{
std::cout << "==============================\n"
<< "Please choose a way to continue:\n"
<< "l: login\n"
<< "r: register\n"
<< "q: quit\n"
<< "==============================\n" << std::endl;
std::cin >> op;
if (op[0] == 'l')
{
std::cout << "Please input your username: " << std::endl;
std::cin >> userName;
if (now->login(userName) == 0)
break;
}
else if (op[0] == 'r')
{
now->regist();
}
else if (op[0] == 'q')
{
return 0;
}
else
{
std::cout << "Invalid input, try again." << std::endl;
}
}
now->p->listen();
delete now;
return 0;
}