Skip to content

Instantly share code, notes, and snippets.

@folivetti
Created February 17, 2017 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save folivetti/452c807807a810c420e9e7028bc5d42c to your computer and use it in GitHub Desktop.
Save folivetti/452c807807a810c420e9e7028bc5d42c to your computer and use it in GitHub Desktop.
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
double A, B, C, area;
Scanner sc = new Scanner(System.in);
A = sc.nextDouble();
B = sc.nextDouble();
C = sc.nextDouble();
area = A*C/2;
System.out.printf("TRIANGULO: %.3f\n", area);
area = 3.14159*C*C;
System.out.printf("CIRCULO: %.3f\n", area);
area = (A+B)*C/2;
System.out.printf("TRAPEZIO: %.3f\n", area);
area = B*B;
System.out.printf("QUADRADO: %.3f\n", area);
area = A*B;
System.out.printf("RETANGULO: %.3f\n", area);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment