simonradev

Hospital

Sep 30th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace hospital
  4. {
  5.     class Program
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             ushort days = ushort.Parse(Console.ReadLine());
  10.             int doctors = 0;
  11.             int bonusDoctors = 0;
  12.             int treated = 0;
  13.             int untreated = 0;
  14.            
  15.            
  16.             for (int day = 1; day <= days; day++)
  17.             {
  18.                 ushort pacientInput = ushort.Parse(Console.ReadLine());
  19.                
  20.                 if (pacientInput > 7)
  21.                 {
  22.                     if (day%3 == 0)
  23.                     {
  24.                         bonusDoctors++;
  25.                     }
  26.                    
  27.                     doctors = (7 + bonusDoctors);
  28.                     treated += (7 + bonusDoctors);
  29.                     untreated += (pacientInput - doctors);
  30.                 }
  31.                
  32.                 else
  33.                 {
  34.                     treated += pacientInput;
  35.                 }
  36.                    
  37.             }
  38.            
  39.             Console.WriteLine("Treated patients: {0}.", treated);
  40.             Console.WriteLine("Untreated patients: {0}.",untreated);
  41.            
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment