Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Loops5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int period = int.Parse(Console.ReadLine());
- int doctors = 7;
- int treatedPatients = 0;
- int untreatedPatients = 0;
- int doctorCount = 7;
- for (int i = 1; i <= period; i++)
- {
- int pacients = int.Parse(Console.ReadLine());
- if (i%3==0)
- {
- if (treatedPatients < untreatedPatients)
- {
- doctorCount++;
- }
- }
- if (pacients>doctorCount)
- {
- untreatedPatients += pacients - doctorCount;
- treatedPatients += doctorCount;
- }
- else
- {
- treatedPatients += pacients;
- }
- }
- Console.WriteLine($"Treated patients: {treatedPatients}.");
- Console.WriteLine($"Untreated patients: {untreatedPatients}.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment