hdoj-acm1071 (JAVA) Definite integral

Source: Internet
Author: User

This problem do a little helpless, definite integral has forgotten almost ~ also hateful to search the parabola of analytic method ~ haha

But the result is wrong ... Wait until you have time to study this math problem--

Here is the Java implementation:

ImportJava.io.BufferedInputStream;ImportJava.util.Scanner; Public classMain { Public Static voidMain (string[] args) {Scanner scan=NewScanner (NewBufferedinputstream (system.in)); intn =Scan.nextint ();  while(N--! =0){            DoubleX1 =scan.nextdouble (); DoubleY1 =scan.nextdouble (); Doublex2 =scan.nextdouble (); Doubley2 =scan.nextdouble (); Doublex3 =scan.nextdouble (); DoubleY3 =scan.nextdouble (); DoubleA = ((y2-y1) * (X3-X2)/(X2-X1)-(Y3-y2))/((x2*x2-x1*x1) * (X3-X2)/(X2-X1)-(x3*x3-x2*x2)); DoubleB = ((y2-y1)-a* (X2*X2-X1*X1))/(x2-x1); Doublec = y1-a*x1*x1-b*X1; Doubles = (a/3*x3*x3*x3+b/2*x3*x3+c*x3)-(A/3*X2*X2*X2+B*X2*X2/2+C*X2)-(y3+y2) * (X3-X2)/2; System.out.printf ("%.2f", s);        System.out.println ();    } scan.close (); }}

hdoj-acm1071 (JAVA) Definite integral

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.