-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
57 lines (52 loc) · 1.4 KB
/
main.cpp
File metadata and controls
57 lines (52 loc) · 1.4 KB
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
50
51
52
53
54
55
56
#include <iostream>
#include <fstream>
#include "Student.h"
#include <vector>
#include <cstring>
using namespace std;
void showChoice(){
cout << "\n\n-------欢迎使用学生管理系统-------\n";
cout << "\t1. 添加学生信息\n";
cout << "\t2. 删除学生信息\n";
cout << "\t3. 修改学生信息\n";
cout << "\t4. 查看学生信息\n";
cout << "\t5. 执行自定义sql语句\n";
cout << "\t6. 把sql语句的执行结果存为文件\n";
cout << "\t7. 把文件中的数据导入到数据库\n";
cout << "\t8. 退出\n";
cout << "------------------------------\n\n";
cout<<"Please input a number:"<<endl;
}
int main() {
auto *student = new Student;
int choice;
while (true){
showChoice();
cin>>choice;
switch (choice) {
case 1:
student->add();
break;
case 2:
student->del();
break;
case 3:
student->change();
break;
case 4:
student->query();
break;
case 5:
student->execYourSql();
break;
case 6:
student->sqlResultToFile();
break;
case 7:
student->fileToDB();
break;
default:
return 0;
}
}
}