-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.h
More file actions
59 lines (57 loc) · 2.23 KB
/
view.h
File metadata and controls
59 lines (57 loc) · 2.23 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
#include "big_num_op.h"
/*
// 本头文件中,定义了主要的交互界面
// 包含欢迎界面:输出欢迎信息
// 用户交互界面:提示用户选择哪种运算
*/
//欢迎界面
void prtWelcomeUI(){
system("CLS");
printf("\n\n");
printf("======================欢迎使用“长整数四则运算”计算器==========================\n");
printf("==============================================================================\n");
printf("=============================键入任意键继续……=================================\n");
printf("==============================================================================\n");
if(getch()){
prtMainUI();
return;
}
else {
prtWelcomeUI();
return;
}
}
//用户交互主界面
void prtMainUI(){
system("CLS");
//time_t timep;
//struct tm *p;
//time(&timep);
//p = localtime(&timep); //获取系统时间
//printf("%d/%d/%d\n",p->tm_year+1900,p->tm_mon+1,p->tm_mday);
printf("\n\n\n");
printf("=====================================选项=====================================\n");
printf(" 1.加法 2.减法 3.乘法\n");
printf(" 0.退出计算器\n");
printf("==============================================================================\n");
printf("请选择需要的运算[1 - 3]: ");
return;
}
//输出当前执行的运算,提示用户注意输入格式
void prtInputFormatUI(char op){
switch (op){
case '1': //加法
printf("\n=====================================加法=====================================\n");
break;
case '2': //减法
printf("\n=====================================减法=====================================\n");
break;
case '3': //乘法
printf("\n=====================================乘法=====================================\n");
break;
default:
return ;
}
printf("\t输入示例: \t1,2345,6789;\t-1,0001,0001;\n"); //提示用户注意输出格式
printf("==============================================================================\n\n");
}