Advertisement
IGRODELOFF

HW: Policlinic

Oct 30th, 2024
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | Gaming | 0 0
  1. using System;
  2.  
  3. namespace homeWorkPoleclinic
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int countPatients;
  10.             int receptionTimeInSecond = 600;
  11.             int calculationTimeSeconds;
  12.             int calculationTimeMinutes;
  13.             int calculationTimeHours;
  14.  
  15.             float remainingSeconds;
  16.             float remainingMinutes;
  17.  
  18.             int convertTime = 60;
  19.  
  20.             Console.Write("Введиие количество пациентов в очереди: ");
  21.             countPatients = Convert.ToInt32(Console.ReadLine());
  22.  
  23.             calculationTimeSeconds = countPatients * receptionTimeInSecond;
  24.  
  25.             calculationTimeMinutes = calculationTimeSeconds / convertTime;
  26.             remainingSeconds = calculationTimeSeconds % convertTime;
  27.  
  28.             calculationTimeHours = calculationTimeMinutes / convertTime;
  29.             remainingMinutes = calculationTimeMinutes % convertTime;
  30.  
  31.             Console.WriteLine($"Вы должны отстоять в очередь {calculationTimeHours} час-а, {remainingMinutes} минут-ы и {remainingSeconds} секунд-ы.");
  32.         }
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement