第一题
来源:互联网 发布:电视软件看电影免费 编辑:程序博客网 时间:2024/04/29 08:04
#include <iostream>
#include <cmath>
using namespace std;
int main()
{double a,b,c,s,area;
cout<<"please input a,b,c:";
cin>>a>>b>>c;
if (a+b<=c)
cerr<<"a+b<=c,error!"<<endl;
else if(b+c<=a)
cerr<<"b+c<=a,error!"<<endl;
else if (c+a<=b)
cerr<<"c+a<=b,error!"<<endl;
else
{s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
cout<<"area="<<area<<endl;}
return 0;
#include <cmath>
using namespace std;
int main()
{double a,b,c,s,area;
cout<<"please input a,b,c:";
cin>>a>>b>>c;
if (a+b<=c)
cerr<<"a+b<=c,error!"<<endl;
else if(b+c<=a)
cerr<<"b+c<=a,error!"<<endl;
else if (c+a<=b)
cerr<<"c+a<=b,error!"<<endl;
else
{s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
cout<<"area="<<area<<endl;}
return 0;
}
0 0
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- 第一题
- C++第八章
- Selenium webdriver 之浏览器操作
- C实现 LeetCode->Reorder List (双指针大法)(单链表是否有环)
- Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
- PowerPoint的母版利用技巧
- 第一题
- 二叉树基本操作
- ppt款式怎么转换成swf款式
- JavaScript学习笔记(数组篇)
- 第四题
- 游戏上线前需要注意的一些技术问题
- 文章标题
- 第五题
- 微软经典的算法面试100题之32题