-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF10PokeMon.java
More file actions
32 lines (23 loc) · 766 Bytes
/
F10PokeMon.java
File metadata and controls
32 lines (23 loc) · 766 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
package DataTypesandVariables;
import java.util.Scanner;
public class F10PokeMon {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int power = Integer.parseInt(scanner.nextLine());
int startPower = power;
int distance = Integer.parseInt(scanner.nextLine());
int factor = Integer.parseInt(scanner.nextLine());
int count = 0;
while (power >= distance) {
power -= distance;
count++;
if (power == startPower / 2) {
if (factor!=0) {
power = power / factor; // power /= factor
}
}
}
System.out.println(power);
System.out.println(count);
}
}