Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _23.PokeMon
- {
- class Program
- {
- static void Main(string[] args)
- {
- int life = int.Parse(Console.ReadLine());
- int distance = int.Parse(Console.ReadLine());
- int exhaustionFactor = int.Parse(Console.ReadLine());
- int pokeCounter = 0;
- double lifeCheck = life * 0.5;
- while (life >= distance)
- {
- life -= distance;
- pokeCounter++;
- if (life == lifeCheck)
- {
- life /= exhaustionFactor;
- }
- }
- Console.WriteLine(life);
- Console.WriteLine(pokeCounter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement