Advertisement
SaNik74

Basics of programming. Lesson #7. Old ladies in polyclinic

Feb 14th, 2023 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. internal class Program
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         int numberOfOldLadies;
  6.         int fixedMinutesOfWaiting = 10;
  7.         int minutesInHour = 60;
  8.         int hoursOfWaiting;
  9.         int minutesOfWaiting;
  10.  
  11.         Console.Write("Введите количество старушек в очереди: ");
  12.         numberOfOldLadies = Convert.ToInt32(Console.ReadLine());
  13.  
  14.         hoursOfWaiting = numberOfOldLadies * fixedMinutesOfWaiting / minutesInHour;
  15.         minutesOfWaiting = numberOfOldLadies * fixedMinutesOfWaiting % minutesInHour;
  16.  
  17.         Console.WriteLine($"Время ожидания составит {hoursOfWaiting} часов и {minutesOfWaiting} минут");
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement