Last active
January 21, 2023 12:01
-
-
Save GigaOrts/7612b8053c60222f71a7b7b0efa4c587 to your computer and use it in GitHub Desktop.
Домашка 8 Основы
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ЯЮниор_Домашка | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int minutesInHour = 60; | |
int minutesForOnePerson = 10; | |
int waitingTimeInMinutes; | |
int waitingTimeInHours; | |
int totalTimeInQueue; | |
Console.WriteLine("Сколько в очереди человек? - "); | |
int lengthOfQueue = Convert.ToInt32(Console.ReadLine()); | |
totalTimeInQueue = minutesForOnePerson * lengthOfQueue; | |
Console.Write($"Время до Вашей очереди "); | |
if (totalTimeInQueue >= minutesInHour) | |
{ | |
waitingTimeInHours = totalTimeInQueue / minutesInHour; | |
Console.Write($"{waitingTimeInHours} ч."); | |
if (totalTimeInQueue % minutesInHour != 0) | |
{ | |
waitingTimeInMinutes = totalTimeInQueue - waitingTimeInHours * minutesInHour; | |
Console.WriteLine($" {waitingTimeInMinutes} мин."); | |
} | |
} | |
else | |
{ | |
Console.WriteLine($"{totalTimeInQueue} мин."); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment