uva 11437 - Triangle Fun

来源:互联网 发布:余文乐有淘宝店吗 编辑:程序博客网 时间:2024/06/05 12:40
#include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>#include <vector>#include <math.h>using namespace std;struct Point { double x, y; };double area(Point a, Point b, Point c){ return a.x*b.y+b.x*c.y+c.x*a.y-a.x*c.y-b.x*a.y-c.x*b.y; }int main(){    Point a, b, c;    int t;    cin >> t;    while(t--)    {        cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;        printf("%.0lf\n", area(a, b, c)/14);    }    return 0;}

原创粉丝点击