Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- double r1,r2,r3,x,y,z,X,Xr,Y,Yr,Z,Zr,tarea,s,area;
- int n,i;
- scanf("%d",&n);
- for(i=1;i<=n;i++){
- scanf("%lf%lf%lf",&r1,&r2,&r3);
- x = r2 + r3;
- y = r1 + r3;
- z = r1 + r2;
- s = (x+y+z)/2;
- tarea = sqrt(s*(s-x)*(s-y)*(s-z));
- X = acos((y*y+z*z-x*x)/(2*y*z));
- Y = acos((z*z+x*x-y*y)/(2*x*z));
- Z = acos((x*x+y*y-z*z)/(2*x*y));
- area = tarea - (0.5)*(r1*r1*X+r2*r2*Y+r3*r3*Z);
- printf("Case %d: %.08lf\n",i,area);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement