Задача 08.Cookie factory от Nested Loops- моля, помогнете - какво не е наред?
using System;
namespace _08._Cookie_factory
{
class Program
{
static void Main(string[] args)
{
int batchesCount = int.Parse(Console.ReadLine()); //брой партиди за печене
for (int i = 1; i <= batchesCount; i++)
{
bool containsEggs = false; // яйца
bool containsFlour = false; // брашно
bool containsSugar = false; // захар
string ingredient = string.Empty;
while (!containsEggs || !containsFlour || !containsSugar || ingredient != "Bake!")
{
ingredient = Console.ReadLine();
if (ingredient == "eggs")
{
containsEggs = true;
}
else if (ingredient == "flour")
{
containsFlour = true;
}
else if (ingredient == "sugar")
{
containsSugar = true;
}
}
if (containsEggs && containsFlour && containsSugar)
{
Console.WriteLine($"Baking batch number {i}...");
}
else if (ingredient == "Bake!")
{
Console.WriteLine($"The batter should contain flour, eggs and sugar!");
break;
}
}
}
}
}
https://softuni.bg/trainings/resources/officedocument/38884/lab-problem-descriptions-programming-basics-with-csharp-february-2019/2275
https://judge.softuni.bg/Contests/Submissions/View/10723143
Здравей,
Ето това би трявало да работи: https://pastebin.com/SSzXdbFE
лесно ще откриеш разликите.