View Code of Problem 24

import java.util.Scanner;

public class Main{
	
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		while(scanner.hasNext()) {
			int a=scanner.nextInt();
			int b=scanner.nextInt();
			int c=scanner.nextInt();
			double p=(a+b+c)*1.0/2;
			System.out.printf("%.2f\n",Math.sqrt(p*(p-a)*(p-b)*(p-c)));
		}
	}
	
	
}

Double click to view unformatted code.


Back to problem 24