#include <iostream>
using namespace std; //try尝试执行,抛出throw,throw之后语句不再执行
//catch处理throw的异常 void main()
{
float fl1, fl2;
cin >> fl1 >> fl2; //尝试执行,抛出类型检测
try
{
if (fl2 < 0.0000001)
{
throw ;
}
else if (fl1 < 0.000001)
{
throw ;
} float fl3 = fl1 / fl2;
cout << fl3 << endl;
}
//定义类型,检测判断是什么错误
catch (int code)
{
if (code == )
{
cout << "fl2太小" << endl;
}
else if (code == )
{
cout << "fl2太小" << endl;
}
} cin.get();
cin.get();
}

最新文章

  1. java Io文件输入输出流 复制文件
  2. WinForm窗体代码结构优化
  3. MySQL(三) —— 约束以及修改数据表
  4. genymotion是一款完全超越BlueStacks
  5. linux网卡绑定
  6. CodeForces 711D Directed Roads (DFS判环+计数)
  7. cf509A Maximum in Table
  8. iOS开发者需要的5款排版工具
  9. EF批量插入(转)
  10. for循环-0,1,1,2,2可以组成多少个不重复的五位数?
  11. django restframework 跨域访问
  12. eclipse 报错问题:java.lang.ClassNotFoundException:
  13. kubernets kubevirt 分析
  14. 多元高斯分布(The Multivariate normal distribution)
  15. git上传中的排除的配置文件, git实际的操作代码;
  16. Three.js基础探寻三——透视投影照相机
  17. Codeforces Round #372 (Div. 1) A. Plus and Square Root 数学题
  18. 在Linux下用make指令编译进度条程序。
  19. thymeleaf 配置
  20. 20165203迭代和JDB测试

热门文章

  1. 【POJ 1082】 Calendar Game
  2. 2017第34周复习Java总结
  3. 【转】详述iOS国际化
  4. 剑指offer——05用两个栈实现队列(Python3)
  5. Linux top命令简解
  6. [实验楼]python11期--NO.1(未完成)
  7. IOS - autoresizingMask
  8. There are multiple modules with names that only differ in casing.
  9. 九、frp对外提供简单的文件访问服务
  10. ItChat与图灵机器人的结合