Advertisement
Valeri12580

Pokemon

Feb 3rd, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 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. int pokePowerN=Integer.parseInt(scanner.nextLine());
  7. int distanceM=Integer.parseInt(scanner.nextLine());
  8. int exhaustionFactorY =Integer.parseInt(scanner.nextLine());
  9. int counter=0;
  10. int originalValueofN=pokePowerN;
  11.  
  12. while(pokePowerN>=distanceM){
  13. pokePowerN-=distanceM;
  14. counter++;
  15.  
  16. if (pokePowerN==(originalValueofN*0.50)) {
  17. if (0<exhaustionFactorY){
  18. pokePowerN/=exhaustionFactorY;
  19. }
  20.  
  21. }
  22.  
  23. }
  24.  
  25. System.out.println(pokePowerN);
  26. System.out.println(counter);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement