Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace C_sharp_Light
- {
- class Program
- {
- static void Main(string[] args)
- {
- uint peopleInQueue;
- uint timeReceptionPerson = 10;
- while (true)
- {
- Console.WriteLine("Программа для расчета времени ожидания в очереди.\n");
- Console.Write("Сколько людей вы видите? Людей - ");
- if (!uint.TryParse(Console.ReadLine(), out peopleInQueue))
- {
- Console.WriteLine("Ошибка.Попробуйте ещё раз ввести количество людей.");
- Console.ReadKey();
- Console.Clear();
- continue;
- }
- break;
- }
- uint hours = peopleInQueue * timeReceptionPerson / 60;
- uint minute = peopleInQueue * timeReceptionPerson % 60;
- Console.WriteLine($"\nВ очереди {peopleInQueue} людей.\n" +
- $"Вы будете ждать своей очереди {hours} часа и {minute} минут");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement