-
-
Save folivetti/bc1caa81f06812fbb6171605f8e99984 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
double A, B, C, temp; | |
Scanner sc = new Scanner(System.in); | |
A = sc.nextDouble(); | |
B = sc.nextDouble(); | |
C = sc.nextDouble(); | |
if (A < B) { | |
temp = A; | |
A = B; | |
B = temp; | |
} | |
if (A < C) { | |
temp = A; | |
A = C; | |
C = temp; | |
} | |
if (B < C) { | |
temp = B; | |
B = C; | |
C = temp; | |
} | |
if ( A >= (B+C) ) { | |
System.out.println("NAO FORMA TRIANGULO"); | |
} else { | |
if ( A*A == (B*B + C*C) ) { | |
System.out.println("TRIANGULO RETANGULO"); | |
} else if ( A*A > (B*B + C*C) ) { | |
System.out.println("TRIANGULO OBTUSANGULO"); | |
} else { | |
System.out.println("TRIANGULO ACUTANGULO"); | |
} | |
if (A==B && B==C) { | |
System.out.println("TRIANGULO EQUILATERO"); | |
} else if (A==B || B==C || A==C) { | |
System.out.println("TRIANGULO ISOSCELES"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment