Sininerebane

Untitled

May 17th, 2023
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | Cybersecurity | 0 0
  1. namespace Console_AppTry
  2. {
  3.     internal class Program
  4.     {
  5.         static void Main(string[] args)
  6.  
  7.         {
  8.             int peopleInQueue;
  9.             int appointmentLength = 10;
  10.             int hour;
  11.             int minutes;
  12.  
  13.             Console.WriteLine("Введите количество людей в очереди");
  14.             peopleInQueue = Convert.ToInt32(Console.ReadLine());
  15.             Console.WriteLine(" Учитывайте, что фиксированное время приема одного человека всегда равно 10 минутам");
  16.  
  17.             hour = peopleInQueue * appointmentLength / 60;
  18.             minutes = peopleInQueue * appointmentLength % 60;
  19.  
  20.             if (hour == 0)
  21.             {
  22.                 Console.WriteLine("Вам ждать своей очереди {0} минут.", minutes);
  23.             }
  24.             else
  25.             {
  26.                 Console.WriteLine("Вам ждать своей очереди {0} часов,  и {1} минут.", hour, minutes);
  27.             }
  28.  
  29.             Console.ReadKey(); //Ожидается нажание какой либо клавиши
  30.  
  31.             }
  32.         }
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment