Advertisement
elvirynwa

PokeMon

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