POJ 2242
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
#define PI 3.141592653589793 struct node
{
double x;
double y;
}; node p_1;
node p_2;
node p_3; double a;
double b;
double c;
double give_len(node a,node b); int main()
{
//freopen("acm.acm","r",stdin);
double cos_c;
double sin_c;
double s;
while(cin>>p_1.x>>p_1.y>>p_2.x>>p_2.y>>p_3.x>>p_3.y)
{
a = give_len(p_1,p_2);
b = give_len(p_1,p_3);
c = give_len(p_2,p_3);
// cout<<"--- a"<<a<<endl;
// cout<<b<<endl;
// cout<<c<<endl;
cos_c = (a*a + b*b - c*c)/(2.0*a*b);
sin_c = sqrt(( - cos_c*cos_c));
s = 0.5 * a*b*sin_c;
cout<<setiosflags(ios::fixed)<<setprecision()<<a*b*c*PI/(s*2.0)<<endl;
}
} double give_len(node a,node b)
{
return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y - b.y)*(a.y - b.y) );
}
POJ 2242的更多相关文章
- POJ 2242 The Circumference of the Circle
做题回顾:用到海伦公式,还有注意数据类型,最好统一 p=(a+b+c)/2; s=sqrt(p*(p-a)*(p-b)*(p-c));//三角形面积,海伦公式 r=a*b*c/(4*s);//这是外接 ...
- poj 2242(已知三点求外接圆周长)
The Circumference of the Circle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8310 ...
- POJ 题目分类(转载)
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965 ...
- (转)POJ题目分类
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. ...
- poj分类
初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. ( ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
- POJ题目分类(转)
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. ...
- 【转载】图论 500题——主要为hdu/poj/zoj
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...
随机推荐
- css样式记忆
text-indent: 2em; //开头空两格: display : none; //隐藏元素 background:#CCC; //背景颜色 background: url(imag ...
- 2018.07.03 HDU Rikka with Phi(线段树)
Rikka with Phi Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) P ...
- 2018.09.15 poj1734Sightseeing trip(floyd求最小环)
跟hdu1599差不多.. 只是需要输出方案. 这个可以递归求解. 代码: #include<iostream> #include<cstdio> #include<cs ...
- 2018.09.10 bzoj1499: [NOI2005]瑰丽华尔兹(单调队列优化dp)
传送门 单调队列优化dp好题. 这题其实很简单. 我们很容易想到一个O(T∗n∗m)" role="presentation" style="position: ...
- gj5 自定义序列类
5.1 序列类型的分类 容器序列 list.tuple.deque扁平序列[同一种数据类型] str.bytes.bytearray.array.array可变序列 list, deque,by ...
- linux下mysql命令大全
1.linux下启动mysql的命令: mysqladmin start /ect/init.d/mysql start (前面为mysql的安装路径) 2.linux下重启mysql的命令: mys ...
- LdA笔记
LDA算法最初的论文使用的是变分EM方法训练(Variational Inference).该方法较为复杂,而且最后训练出的topic主题非全局最优分布,而是局部最优分布.后期发明了Collapsed ...
- AWS S3 CLI的安装和配置
以Ubuntu系统为例,说明如何使用CLI调试AWS S3环境: 1. 安装 # sudo pip install awscli 2. 配置AWS CLI 执行命令aws configure, 注意, ...
- hdu 2086 A1 = ?(数学题)
转载链接 因为:Ai=(Ai-1+Ai+1)/2 - Ci, A1=(A0 +A2 )/2 - C1; A2=(A1 + A3)/2 - C2 , ... => ...
- 使用for in循环遍历json对象的数据
使用for in遍历json对象数据,如果数据中的名称有为数字的话,只对正整数有效,那么先会输出为正整数的数据,后面其他的会按照原来数据中定义的顺序不变输出. 针对名称为数字的json对象数据进行测试 ...