View Code of Problem 24

import java.util.Scanner;
public class Main {
	public void sum(int a,int b,int c){
		double d=0.5*(a+b+c);
		double t=Math.sqrt(d*(d-a)*(d-b)*(d-c));
		t=(double)Math.round(t*100)/100;
		System.out.println(t);
	}
	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int a=s.nextInt();
		int b=s.nextInt();
		int c=s.nextInt();
		Main test=new Main();
		test.sum(a,b,c);
		}
}

Double click to view unformatted code.


Back to problem 24