Advertisement
silvana1303

poke mon

Jun 19th, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Diagnostics.CodeAnalysis;
  5. using System.Linq;
  6. using System.Runtime.CompilerServices;
  7. using System.Threading;
  8. using System.Xml;
  9.  
  10. namespace ConsoleApp1
  11. {
  12.     class Exam
  13.     {
  14.         static void Main(string[] args)
  15.         {
  16.             int power = int.Parse(Console.ReadLine()); //N
  17.             int distance = int.Parse(Console.ReadLine()); //M
  18.             int exhaustion = int.Parse(Console.ReadLine()); //Y
  19.  
  20.             int original = power;
  21.  
  22.             int count = 0;
  23.  
  24.             while (power >= distance)
  25.             {
  26.                 power -= distance;
  27.                 count++;
  28.  
  29.                 if (power == original / 2.0)
  30.                 {
  31.                     if (exhaustion > 0)
  32.                     {
  33.                         power /= exhaustion;
  34.                     }
  35.                 }
  36.             }
  37.  
  38.             Console.WriteLine(power);
  39.             Console.WriteLine(count);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement