lovelyvook

Unit_06

Mar 30th, 2024
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Ijunior
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int totalPatients;
  14.             int minutesForPatient = 10;
  15.             int totalTimeWait;
  16.             int hour = 60;
  17.             int hourWait;
  18.             int minuteWait;
  19.  
  20.             Console.Write("Сколько пациентов перед вами? ");
  21.             totalPatients = Convert.ToInt32(Console.ReadLine());
  22.  
  23.             totalTimeWait = totalPatients * minutesForPatient;
  24.             hourWait = totalTimeWait / hour;
  25.             minuteWait = totalTimeWait % hour;
  26.  
  27.             Console.WriteLine($"Впереди вас очередь в {totalPatients} человек, время ожидания составит {hourWait} час и {minuteWait} минут");
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment