Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace hospital
- {
- class Program
- {
- public static void Main(string[] args)
- {
- ushort days = ushort.Parse(Console.ReadLine());
- int doctors = 0;
- int bonusDoctors = 0;
- int treated = 0;
- int untreated = 0;
- for (int day = 1; day <= days; day++)
- {
- ushort pacientInput = ushort.Parse(Console.ReadLine());
- if (pacientInput > 7)
- {
- if (day%3 == 0)
- {
- bonusDoctors++;
- }
- doctors = (7 + bonusDoctors);
- treated += (7 + bonusDoctors);
- untreated += (pacientInput - doctors);
- }
- else
- {
- treated += pacientInput;
- }
- }
- Console.WriteLine("Treated patients: {0}.", treated);
- Console.WriteLine("Untreated patients: {0}.",untreated);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment