-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dragon.java
47 lines (36 loc) · 1.73 KB
/
Dragon.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
45
46
47
/*
====================================================
Desafios Básicos - Banco PAN Java Developer
====================================================
4/5 - Dragão
====================================================
Desafio
Daenerys é a khaleesi dos Dothraki. Juntamente com Drogon, eles vão atrás do Tyrion, para tentar dominar Westeros. Ela possui, além do seu dragãozinho, um rastreador que mede o nível de energia de qualquer ser vivo. Todos os seres com o nível menor ou igual a 8000, ela considera como se fosse um inseto. Quando passa deste valor, que foi o caso do Drogon, ela se espanta e grita “Mais de 8000”. Baseado nisso, utilize a mesma tecnologia e analise o nível de energia dos seres vivos.
Entrada
A primeira linha contém um número inteiro C relativo ao número de casos de teste. Em seguida, haverá C linhas, com um número inteiro N (100 <= N <= 100000) relativo ao nível de energia de um ser vivo.
Saída
Para cada valor lido, imprima o texto correspondente.
-----------------------------------------
| Exemplo de Entrada | Exemplo de Saída |
-----------------------------------------
| 3 | Mais de 8000! |
| 8001 | Inseto! |
| 100 | Inseto! |
| 200 | |
-----------------------------------------
SOLUÇÃO ABAIXO: */
import java.util.Scanner;
public class Dragon{
public static void main(String[] args){
int casos, poderDeLuta;
Scanner ler = new Scanner(System.in);
casos = ler.nextInt();
for(int i = 0; i < casos; i++){
poderDeLuta = ler.nextInt();
System.out.println(
(poderDeLuta > 8000) ? "Mais de 8000!" : "Inseto!"
);
}
ler.close();
}
}