zoj 1439
来源:互联网 发布:梦幻西游老网络错误 编辑:程序博客网 时间:2024/05/05 04:01
好吧。。坑爹了。。一个公式都记不得。。。。
/*zoj_1439 数论内接圆公式:r=2*s/(a+b+c)外切圆公式:R=(a*b*c)/(4*s)海伦公式p=(a+b+c)/2; s=sqrt( p*(p-a)*(p-b)*(p-c) );*/#include <iostream>#include <cstdio>#include <math.h>using namespace std;int main(){ double x1,y1,z1,x2,y2,z2,x3,y3,z3; double a,b,c,s,p,r,R; while( scanf( "%lf%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&z1,&x2,&y2,&z2,&x3,&y3,&z3 )!=EOF ) { a=sqrt( (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2) ); b=sqrt( (x1-x3)*(x1-x3)+(y1-y3)*(y1-y3)+(z1-z3)*(z1-z3) ); c=sqrt( (x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)+(z2-z3)*(z2-z3) ); p=(a+b+c)/2; s=sqrt( p*(p-a)*(p-b)*(p-c) ); R=a*b*c/(4*s); r=2*s/(a+b+c); printf( "%.3lf\n",r*r/(R*R) ); } return 0;}
- zoj 1439
- ZOJ-1439
- zoj 1439 Area Ratio
- zoj 1439 Area Ratio
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- ZOJ
- Linux创建静态库
- Android中sqlite数据库的简单使用
- UIWebView 相应本地事件
- 中医教你怎样泡脚最养生
- 一个合格程序员该做的事情——你做好了吗?
- zoj 1439
- 我想买个键盘:用户需求可以多么刁钻
- 疑难区
- 【转载】WINCE下telnet,FTP及网络共享的使用方法
- codeigniter 笔记三
- SQL Server自动备份脚本
- 用 PHP 读取文件的正确方法
- Java文件路径
- miscrosoft visio 2003记