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);
        }
    }


  • 相关阅读:
    Dubbo2.0
    Dubbo--RPC框架
    ActiveMQ消息队列
    quartz开源任务调度框架
    webService
    crud最常用
    springBoot第三天
    springmvc--依赖
    springBoot第二天
    pom.xml和settings.xml的下载优先级
  • 原文地址:https://www.cnblogs.com/Open_Source/p/1904959.html
Copyright © 2011-2022 走看看