Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _01ProgramingFundamentallongensiveExamJuly2017
- {
- class Program
- {
- static void Main(string[] args)
- {
- double pokemonPower = double.Parse(Console.ReadLine());
- double distance = double.Parse(Console.ReadLine());
- double exaustion = double.Parse(Console.ReadLine());
- double startingpower = pokemonPower;
- double target = 0;
- double compare =Math.Floor( pokemonPower / 2);
- while(startingpower>=distance)
- {
- startingpower = startingpower - distance;
- target++;
- if(startingpower== compare)
- {
- startingpower = Math.Floor( startingpower / exaustion);
- }
- }
- Console.WriteLine(startingpower);
- Console.WriteLine(target);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment