-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP112.java
More file actions
35 lines (32 loc) · 1023 Bytes
/
P112.java
File metadata and controls
35 lines (32 loc) · 1023 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
31
32
33
34
35
package p100_199;
import java.util.Scanner;
//accepted
public class P112 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double distancia= sc.nextInt();
double limite= sc.nextInt();
double tiempo= sc.nextInt();
double v;
while(distancia!=0 || limite!=0 || tiempo!=0){
if (tiempo<=0 || limite<=0 || distancia<=0){
System.out.println("ERROR");
} else {
limite /= 3.6;
v = distancia / tiempo;
if (v >limite) {
if (v - limite >= 0.2 * limite) {
System.out.println("PUNTOS");
} else {
System.out.println("MULTA");
}
} else {
System.out.println("OK");
}
}
distancia= sc.nextInt();
limite= sc.nextInt();
tiempo= sc.nextInt();
}
}
}