View Code of Problem 24

import java.math.*;
import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner s = new Scanner(System.in);
    int a = s.nextInt();
    int b = s.nextInt();
    int c = s.nextInt();
    double p = (a+b+c)/2;
    double S = Math.sqrt(p*(p-a)*(p-b)*(p-c));
    System.out.println(S);
  }
}

Double click to view unformatted code.


Back to problem 24