标签:des style blog class code color
Time Limit: 1000MS | Memory Limit: 65536K | |||
Total Submissions: 2718 | Accepted: 886 | Special Judge |
Description
Input
Output
Sample Input
1000 1000 1000 3 4 5
Sample Output
根据边来求出四面体的高,然后公式计算。
代码:
/* *********************************************** Author :_rabbit Created Time :2014/5/9 21:32:01 File Name :5.cpp ************************************************ */ #pragma comment(linker, "/STACK:102400000,102400000") #include <stdio.h> #include <iostream> #include <algorithm> #include <sstream> #include <stdlib.h> #include <string.h> #include <limits.h> #include <string> #include <time.h> #include <math.h> #include <queue> #include <stack> #include <set> #include <map> using namespace std; #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) typedef long long ll; double volume(double a,double b,double c,double d,double e,double f){ double a2=a*a,b2=b*b,c2=c*c,d2=d*d,e2=e*e,f2=f*f; double tr1=acos((c2+b2-f2)/(2*b*c)); double tr2=acos((a2+c2-e2)/(2*a*c)); double tr3=acos((a2+b2-d2)/(2*a*b)); double tr4=(tr1+tr2+tr3)/2; double temp=sqrt(sin(tr4)*sin(tr4-tr1)*sin(tr4-tr2)*sin(tr4-tr3)); return a*b*c*temp/3; } int main() { //freopen("data.in","r",stdin); //freopen("data.out","w",stdout); double a,b,c,d,e,f; while(cin>>a>>b>>c>>d>>e>>f)printf("%.4f\n",volume(a,b,c,d,e,f)); return 0; }
POJ 2208 已知空间四面体六条边长度,求体积,布布扣,bubuko.com
标签:des style blog class code color
原文地址:http://blog.csdn.net/xianxingwuguan1/article/details/25427375