Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Hospital
- {
- class Program
- {
- static void Main()
- {
- int period = int.Parse(Console.ReadLine());
- int treated = 0;
- int untreated = 0;
- int doctors = 7;
- for (int i = 1; i <= period; i++)
- {
- int patients = int.Parse(Console.ReadLine());
- _ = untreated > treated && i % 3 == 0 ? doctors++ : doctors;
- _ = patients > doctors ? treated += doctors : treated += patients;
- _ = patients > doctors ? untreated += patients - doctors : untreated;
- }
- Console.WriteLine($"Treated patients: {treated}.\nUntreated patients: {untreated}.");
- }
- }
- }
Add Comment
Please, Sign In to add comment