SHARE
TWEET

PokeMon

elvirynwa Feb 1st, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top