svephoto

PokeMon [C#]

Sep 20th, 2021 (edited)
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace PokeMon
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int power = int.Parse(Console.ReadLine());
  10.             int distance = int.Parse(Console.ReadLine());
  11.             int exhaustionFactor = int.Parse(Console.ReadLine());
  12.  
  13.             int restPower = power;
  14.             int targetsCount = 0;
  15.  
  16.             while (restPower >= distance)
  17.             {
  18.                 restPower -= distance;
  19.                 targetsCount++;
  20.  
  21.                 if (restPower == power * 0.5 && exhaustionFactor != 0)
  22.                 {
  23.                     restPower /= exhaustionFactor;
  24.                 }
  25.             }
  26.  
  27.             Console.WriteLine(restPower);
  28.             Console.WriteLine(targetsCount);
  29.         }
  30.     }
  31. }
  32.  
Add Comment
Please, Sign In to add comment