Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,n,x1,y1,x2,y2,x3,y3,x4,y4,ab,q,are;
- scanf("%d",&n);
- for(i=1;i<=n;i++){
- scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3);
- y4=y1-(y2-y3);
- x4=x1-(x2-x3);
- q=(x1*y2+x2*y3+x3*y4+x4*y1)-(y1*x2+y2*x3+y3*x4+y4*x1);
- if(q<0)
- q=-q;
- are=q/2;
- printf("Case %d: %d %d %d\n",i,x4,y4,are);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement