04. Fast Food
Къде ми е грешката? // Дава 80/100
using System;
using System.Collections.Generic;
using System.Linq;
namespace _4._Fast_Food___Exercise
{
internal class Program
{
static void Main(string[] args)
{
int foodForDay = int.Parse(Console.ReadLine());
int[] orders = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
int result = 0;
Queue<int> queue = new Queue<int>(orders);
Console.WriteLine(queue.Max());
for (int i = 0; i < orders.Length; i++)
{
foodForDay -= orders[i];
if (foodForDay>=orders[i])
{
queue.Dequeue();
continue;
}
result = orders[i];
}
if(foodForDay>=0)
{
Console.WriteLine("Orders complete");
}
else
{
Console.WriteLine($"Orders left: {result}");
}
}
}
}