Advertisement
Guest User

Poke Mon

a guest
Jun 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int originPokePower = int.Parse(Console.ReadLine());
  8.         int pokePower = originPokePower;
  9.         int distance = int.Parse(Console.ReadLine());
  10.         int exhaustionFactor = int.Parse(Console.ReadLine());
  11.  
  12.         int targetCounter = 0;
  13.         while (pokePower >= distance)
  14.         {
  15.             pokePower -= distance;
  16.             if (pokePower == originPokePower / 2
  17.                 && exhaustionFactor > 0)
  18.             {
  19.                 pokePower /= exhaustionFactor;
  20.             }
  21.             targetCounter++;
  22.         }
  23.  
  24.         Console.WriteLine(pokePower);
  25.         Console.WriteLine(targetCounter);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement