Advertisement
bacco

Poke Mon

Jun 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace test
  6. {
  7.     class MainClass
  8.     {
  9.         public static void Main(string[] args)
  10.  
  11.         {
  12.             var power           = int.Parse(Console.ReadLine());
  13.             var distance        = int.Parse(Console.ReadLine());
  14.             var exhaustingIndex = int.Parse(Console.ReadLine());
  15.  
  16.             var counter = 0;
  17.             var currentPower = power;
  18.  
  19.             while (currentPower >= distance)
  20.             {
  21.  
  22.                 currentPower -= distance;
  23.                 counter++;
  24.  
  25.                 if (currentPower == power / 2  &&
  26.                                     power % 2 == 0)
  27.                 {
  28.                     currentPower /= exhaustingIndex;
  29.                 }
  30.  
  31.  
  32.             }
  33.  
  34.             Console.WriteLine(currentPower);
  35.             Console.WriteLine(counter);
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement