-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
37 lines (35 loc) · 1.13 KB
/
main.c
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
#include "Univariate polynomial calculation.h"
int main(int argc, const char * argv[]) {
int choose;
start();
struct Univariate_polynomial *up1 = NULL, *up2 = NULL;
while(1) {
printf("请输入你选择功能的序号: ");
scanf("%d", &choose);
if(choose > 6 || choose < 1) {
printf("输入不正确,请输入对应功能编号(1~6),谢谢配合!\n");
system("clear");
start();
}
if(choose == 1) {
up1 = Univariate_polynomial_init(1);
up2 = Univariate_polynomial_init(2);
}
else if(choose == 2) {
if(checkNull(up1, up2)) continue;
Univariate_polynomial_add(up1, up2);
}
else if(choose == 3) {
if(checkNull(up1, up2)) continue;
Univariate_polynomial_del(up1, up2);
}
else if(choose == 4) {
if(checkNull(up1, up2)) continue;
Univariate_polynomial_mul(up1, up2);
}
else if(choose == 5) {
printf("谢谢您使用本程序,即将退出~\n");
break;
}
}
}