Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Problem_1.Poke_Mon
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int pokePower = int.Parse(Console.ReadLine());
  14.             int pokeTarget = int.Parse(Console.ReadLine());
  15.             byte exhaustionFactor = byte.Parse(Console.ReadLine());
  16.             int result=pokePower;
  17.             int count=0;
  18.  
  19.  
  20.             for (int i = 1; i >0 ; i++)
  21.             {
  22.                 result = result - pokeTarget;
  23.                 count++;
  24.                 if (result*2==pokePower && exhaustionFactor != 0)
  25.                 {
  26.                     result=result / exhaustionFactor;
  27.                 }
  28.                 if (result<pokeTarget)
  29.                 {
  30.                     break;
  31.                 }
  32.             }
  33.             Console.WriteLine(result);
  34.             Console.WriteLine(count);
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement