Advertisement
Vlad_Savitskiy

Old Queue

Apr 1st, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CSLightFirst
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             const int minutesInOneHour = 60;
  10.             int receiptTimeInMinutes = 10;
  11.             int peopleAmount;
  12.             int totalTimeInQueueInMinutes;
  13.             int hoursInQueue;
  14.             int minutesInQueue;
  15.  
  16.             Console.Write("Количество пенсионерок в очереди: ");
  17.             peopleAmount = Math.Abs(int.Parse(Console.ReadLine()));
  18.  
  19.             totalTimeInQueueInMinutes = peopleAmount * receiptTimeInMinutes;
  20.             hoursInQueue = totalTimeInQueueInMinutes / minutesInOneHour;
  21.             minutesInQueue = totalTimeInQueueInMinutes % minutesInOneHour;
  22.  
  23.             Console.WriteLine($"Вы должны отстоять в очереди пенсионерок {hoursInQueue} ч {minutesInQueue} мин");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement