Advertisement
damesova

Poke Mon - Java

Feb 1st, 2019
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _10_PokeMon {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int pokePowerN = Integer.parseInt(scanner.nextLine());
  8.         int distanceM = Integer.parseInt(scanner.nextLine());
  9.         int exhaustionFactorY = Integer.parseInt(scanner.nextLine());
  10.  
  11.         int count = 0;
  12.         double half = pokePowerN / 2.0;
  13.  
  14.         while (pokePowerN >= distanceM) {
  15.             count++;
  16.  
  17.             pokePowerN -= distanceM;
  18.  
  19.             if (half == pokePowerN) {
  20.                 if (exhaustionFactorY > 0) {
  21.                     pokePowerN /= exhaustionFactorY;
  22.                 }
  23.             }
  24.         }
  25.         System.out.println(pokePowerN);
  26.         System.out.println(count);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement