CY PeriTech
0.0.x
载入中...
搜索中...
未找到
code
main.cpp
浏览该文件的文档.
1
5
6
#include "
calculator.h
"
7
#include <iostream>
8
9
int
main() {
10
Calculator
calc(10.0);
11
12
try
{
13
double
result = calc.add(5.0)
14
.divide(3.0)
15
.getValue();
16
17
std::cout <<
"计算结果: "
<< result << std::endl;
18
}
19
catch
(
const
std::exception& e) {
20
std::cerr <<
"计算错误: "
<< e.what() << std::endl;
21
}
22
23
return
0;
24
}
calculator.h
计算器类的头文件
Calculator
简单的计算器类
定义
calculator.h:19
生成于
, 为 CY PeriTech使用
1.16.0