<swustoj>?id=203 Jack's problem

链接http://acm.swust.edu.cn/problem/203/

#include <stdio.h>
int main()
{
    double x1,x2,x3,y1,y2,y3;
    double s;
    while(~scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3))
    {
        s=(x1*y2+x2*y3+x3*y1-x1*y3-x2*y1-x3*y2)*1.0/2;
        if(s>=0)    
        {    
            printf("%0.1lf\n",s);    
        }
        else    
        {
            s=-s;    
            printf("%0.1lf\n",s);    
        }
    }
    return 0;
}

 

posted @ 2016-07-30 19:52  艹kiss灬不离  阅读(189)  评论(0)    收藏  举报