Guest User

Untitled

a guest
Jan 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. /**********************************************************************************/
  2. /* Problem: d489 "伏林的三角地" from 板橋高中 */
  3. /* Language: JAVA (548 Bytes) */
  4. /* Result: AC(97ms, 2.4MB) judge by this@ZeroJudge */
  5. /* Author: ssc24 at 2011-09-26 12:26:28 */
  6. /**********************************************************************************/
  7.  
  8.  
  9. package javaapplication42;
  10. import java.util.*;
  11. import java.math.*;
  12.  
  13.  
  14.  
  15. public class JavaApplication42 {
  16.  
  17.  
  18. public static void main(String[] args) {
  19.  
  20. Scanner sc = new Scanner(System.in);
  21.  
  22. while (sc.hasNext()){
  23.  
  24. int a =sc.nextInt();
  25. int b =sc.nextInt();
  26. int c =sc.nextInt();
  27. double s =((a+b+c)*0.5);
  28. //int price =(s*(s-a)*(s-b)*(s-c)); // 求面積需要開根號
  29. System.out.printf("%.0f%n",(s*(s-a)*(s-b)*(s-c)));
  30.  
  31.  
  32. }//whlle*/
  33. }//main
  34.  
  35. }//class
Add Comment
Please, Sign In to add comment