zoukankan      html  css  js  c++  java
  • hdoj1077 The area

    #include<iostream>
    #include
    <stdio.h>
    using namespace std;
    int main()
    {
        
    int T;
        
    double x1, x2, x3, y1, y2, y3, a, b, c, ans;
        scanf(
    "%d"&T);
        
    while (T--) {
        scanf(
    "%lf%lf%lf%lf%lf%lf"&x1, &y1, &x2, &y2, &x3, &y3);
        a 
    = (y3 - y1) / ((x3 - x1) * (x3 - x1));
        b 
    = -2 * a * x1;
        c 
    = y1 + (b * b) / (4 * a);
        
    double d = (y2 + y3) * (x3 - x2) / 2;
        ans 
    =
            a 
    / 3 * (x3 * x3 * x3 - x2 * x2 * x2) + b / 2 * (x3 * x3 -
                                     x2 
    * x2) +
            c 
    * (x3 - x2) - d;
        
    if (ans < 0)
            ans 
    *= -1;
        printf(
    "%.2lf\n", ans);
        }
    }


  • 相关阅读:
    MVC模式的学生信息增删改查
    常用排序算法
    2803 爱丽丝·玛格特罗依德
    3118 高精度练习之除法
    中秋练习题
    poj2011
    P1558 色板游戏
    P1830 轰炸III
    P1656 炸铁路
    1067 机器翻译
  • 原文地址:https://www.cnblogs.com/Open_Source/p/1904959.html
Copyright © 2011-2022 走看看