Advertisement
VeselinNeychev

Untitled

Apr 24th, 2019
535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement