-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
65 lines (65 loc) · 2.03 KB
/
main.cpp
File metadata and controls
65 lines (65 loc) · 2.03 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
57
58
59
60
61
62
63
64
65
#include "big_num_op.h"
#include "op_function.h"
#include "view.h"
int main(){
prtWelcomeUI();
DblList first,second,result;
char op;
InitList(first);
InitList(second);
InitList(result);
for (;;) {
scanf("%c",&op);
if(op=='0'){
DestroyList(first);
DestroyList(second);
DestroyList(result);
break;
}
if(op!='0'&&op>'3'){
printf("\n\n输入的编号有误,请核对后再次输入!\n按任意键继续……");
getch();
system("cls");
prtMainUI();
continue;
}
switch (op){
case '1':
prtInputFormatUI(op);
InputInteger(first,second);
//TravelList(first); //testing 测试输入数据
//TravelList(second);
PrtList(first);
PrtList(second);
addition(first,second,result);
printf("\n=============================运算结果=============================");
PrtList(result);
break;
case '2':
prtInputFormatUI(op);
InputInteger(first,second);
PrtList(first);
PrtList(second);
subtraction(first,second,result);
printf("\n=============================运算结果==============================");
PrtList(result);
break;
case '3':
prtInputFormatUI(op);
InputInteger(first,second);
PrtList(first);
PrtList(second);
multiplication(first,second,result);
printf("\n=============================运算结果===============================");
PrtList(result);
break;
// default:
// return 0;
}
ClearList(first);
ClearList(second);
ClearList(result);
prtMainUI();
}
return 0;
}