标签:
0 0 1 1 1 3 0 1 1 0 0 0 0 0 0 0 0 0
1.0 0.5
这个题像是水题,就一个公式,但是我公式带错了,绝对值不是每一项都带,而是一个整体。。再乘以0.5
#include<iostream> #include<stdio.h> #include<cmath> using namespace std; int main() { double x1,y1,x2,y2,x3,y3; double mianji; while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)) { if(x1==0 && y1==0&&x2==0&&y2==0&&x3==0&&y3==0) break; else { double x=x1*y2-x2*y1; double y=x2*y3-x3*y2; double z=x3*y1-x1*y3; mianji=fabs(x+y+z)*0.5; printf("%.1lf\n",mianji); } } return 0; }
标签:
原文地址:http://blog.csdn.net/zuguodexiaoguoabc/article/details/43460083