Aliendreamer

pokemon exam july 1 zadacha

Jul 10th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 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 _01ProgramingFundamentallongensiveExamJuly2017
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.            double  pokemonPower = double.Parse(Console.ReadLine());
  14.             double distance = double.Parse(Console.ReadLine());
  15.             double exaustion = double.Parse(Console.ReadLine());
  16.  
  17.             double startingpower = pokemonPower;
  18.             double target = 0;
  19.             double compare =Math.Floor( pokemonPower / 2);
  20.             while(startingpower>=distance)
  21.             {
  22.                startingpower = startingpower - distance;
  23.                 target++;
  24.                 if(startingpower== compare)
  25.                 {
  26.                     startingpower = Math.Floor( startingpower / exaustion);
  27.                 }
  28.  
  29.  
  30.  
  31.  
  32.             }
  33.             Console.WriteLine(startingpower);
  34.             Console.WriteLine(target);
  35.         }
  36.        
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment