SHARE
TWEET

Untitled

VeselinNeychev Apr 24th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _23.PokeMon
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int life = int.Parse(Console.ReadLine());
  10.             int distance = int.Parse(Console.ReadLine());
  11.             int exhaustionFactor = int.Parse(Console.ReadLine());
  12.             int pokeCounter = 0;
  13.             double lifeCheck = life * 0.5;
  14.             while (life >= distance)
  15.             {
  16.                 life -= distance;
  17.                 pokeCounter++;
  18.                 if (life == lifeCheck)
  19.                 {
  20.                     life /= exhaustionFactor;
  21.                 }
  22.             }
  23.             Console.WriteLine(life);
  24.             Console.WriteLine(pokeCounter);
  25.         }
  26.     }
  27. }
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