Help For ex.4 Hospital
Здравейте, ако може някой да ми помогне със задача 4 от Programming Basics Exam - 28 August 2016. Не мога да мина 70 % в Judge ...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hospital
{
class Hospital
{
static void Main(string[] args)
{
int daysPeriod = int.Parse(Console.ReadLine());
int doctor = 7;
int treated = 0;
int untreated = 0;
int pacient = 0;
for (int i = 1; i <= daysPeriod; i++)
{
pacient = int.Parse(Console.ReadLine());
if (i % 3 == 0 && pacient > doctor )
{
doctor += 1;
}
if (pacient < doctor)
{
treated += pacient;
}
else
{
treated += doctor;
untreated += pacient - doctor;
}
}
Console.WriteLine("Treated patients: {0}.", treated);
Console.WriteLine("Untreated patients: {0}.", untreated);
}
}
}
https://judge.softuni.bg/Contests/Practice/Index/274#3
Благодаря много !
100/100