-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (51 loc) · 1.68 KB
/
main.cpp
File metadata and controls
53 lines (51 loc) · 1.68 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
//
// Created by Donghui Zheng on 2020/12/22 15:05.
//
#include <iostream>
#include "Action.h"
using namespace std;
int main() {
action::welcomeScreen();//调用欢迎界面.
system("pause");
system("cls");
while (true) {//死循环.
int choice;//用户输入的选择.
int flag = 1;//用于判断是否退出运算.
action::directorySelectionScreen();//调用目录选择界面.
cin >> choice;
fflush(stdin);//清除缓存.
while (choice > 3 || choice < 1) {
cout << "您的输入有误,请重新输入!\n" << endl;
action::directorySelectionScreen();//调用目录选择界面.
cin >> choice;
fflush(stdin);//清除缓存.
}
int continueKey;
switch (choice) {
case 1://不涉及文件的大整数计算.
while (flag) {//运算操作.
action::operationWithoutFile();//调用operationWithoutFile函数.
cout << "\n继续运算?(选择1:是/0:否):";
fflush(stdin);//清除缓存.
cin >> continueKey;
flag = continueKey;
system("cls");
}
break;
case 2://涉及文件的大整数计算.
while (flag) {//运算操作.
action::operationWithFile();//调用operationWithFile函数.
cout << "\n继续运算?(选择1:是/0:否):";
fflush(stdin);//清除缓存.
cin >> continueKey;
flag = continueKey;
system("cls");
}
break;
default:
action::exitSystem();
break;
}
}
return 0;
}