Advertisement
ivanov_ivan

PokeMon - C#

Nov 3rd, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. namespace ConsoleApp1
  2. {
  3.     using System;
  4.     using System.Collections.Generic;
  5.     using System.Linq;
  6.  
  7.     public class Program
  8.     {
  9.         public static void Main(string[] args)
  10.         {
  11.  
  12.             int n = int.Parse(Console.ReadLine());
  13.             int m = int.Parse(Console.ReadLine());
  14.             int y = int.Parse(Console.ReadLine());
  15.  
  16.             int counter = 0;
  17.             int originN = n;
  18.  
  19.             while (n >= m)
  20.             {
  21.                 n -= m;
  22.                 counter++;
  23.  
  24.                 if (n == originN * 0.5 && y != 0)
  25.                 {
  26.                     n /= y;
  27.                 }
  28.  
  29.             }
  30.  
  31.             Console.WriteLine(n);
  32.             Console.WriteLine(counter);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement