Advertisement
AziLif

Поликлиника

May 24th, 2024
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int timeForPatient = 10;
  10.             int minutesInHour = 60;
  11.             int numberPatients;
  12.             int totalWaitingTime;
  13.             int waitingTimeHours;
  14.             int waitingTimeMinutes;
  15.  
  16.  
  17.             Console.WriteLine("Сколько пациентов в очереди Вы видите: ");
  18.            
  19.             numberPatients = Convert.ToInt32(Console.ReadLine());
  20.            
  21.             totalWaitingTime = numberPatients * timeForPatient;
  22.             waitingTimeHours = totalWaitingTime / minutesInHour;
  23.             waitingTimeMinutes = totalWaitingTime % minutesInHour;
  24.            
  25.             Console.WriteLine($"На каждого пациента врач отводит {timeForPatient} минут. " +
  26.                               $"Вам придется подождать {waitingTimeHours} час(а) и {waitingTimeMinutes} минут. " +
  27.                               $"Спасибо за посещение нашей клиники.");
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement