Advertisement
fbinnzhivko

05.Elevator

May 28th, 2016
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.         int p = int.Parse(Console.ReadLine());
  8.        
  9.         int courses = n / p;
  10.         int ostatuk = n % p;
  11.        
  12.         if (ostatuk == 0)
  13.         {
  14.             Console.WriteLine(courses);
  15.         }
  16.         else if (ostatuk != 0)
  17.         {
  18.             Console.WriteLine(courses + ostatuk / ostatuk);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement