码迷,mamicode.com
首页 > 其他好文 > 详细

<swustoj>?id=203 Jack's problem

时间:2016-07-30 21:05:12      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

链接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;
}

 

<swustoj>?id=203 Jack's problem

标签:

原文地址:http://www.cnblogs.com/niconiconi/p/5721598.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!