-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx1134.java
More file actions
30 lines (28 loc) · 840 Bytes
/
Copy pathEx1134.java
File metadata and controls
30 lines (28 loc) · 840 Bytes
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
import java.util.Scanner;
public class Ex1134 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int alcool = 0;
int gasolina = 0;
int diesel = 0;
while (true){
int num = input.nextInt();
if (num == 4){
break;
} else if (num == 1) {
alcool += 1;
} else if (num == 2) {
gasolina += 1;
} else if (num == 3) {
diesel += 1;
}
else {
continue;
}
}
System.out.println("MUITO OBRIGADO");
System.out.println("Alcool: " + alcool);
System.out.println("Gasolina: " + gasolina);
System.out.println("Diesel: " + diesel);
}
}