Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class _10_PokeMon {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int pokePowerN = Integer.parseInt(scanner.nextLine());
- int distanceM = Integer.parseInt(scanner.nextLine());
- int exhaustionFactorY = Integer.parseInt(scanner.nextLine());
- int count = 0;
- double half = pokePowerN / 2.0;
- while (pokePowerN >= distanceM) {
- count++;
- pokePowerN -= distanceM;
- if (half == pokePowerN) {
- if (exhaustionFactorY > 0) {
- pokePowerN /= exhaustionFactorY;
- }
- }
- }
- System.out.println(pokePowerN);
- System.out.println(count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement