-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path035.java
44 lines (36 loc) · 1011 Bytes
/
035.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
### 035 - Analisando triângulo v1.0
Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem ou não formar um triângulo
*/
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int a, b, c;
boolean triangulo = false;
Scanner scanner = new Scanner(System.in);
System.out.println("Digite A: ");
a = scanner.nextInt();
System.out.println("Digite B: ");
b = scanner.nextInt();
System.out.println("Digite C: ");
c = scanner.nextInt();
if (a + b > c)
{
if (b + c > a)
{
if (a + c > b)
{
triangulo = true;
}
}
}
if (triangulo)
{
System.out.println("Pode formar um triangulo");
}
else
{
System.out.println("Não pode formar um triangulo");
}
}
}