Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Cookie_factory
- {
- class Program
- {
- static void Main(string[] args)
- {
- int batch = int.Parse(Console.ReadLine());
- bool flour = false;
- bool eggs = false;
- bool sugar = false;
- for (int i = 1; i <= batch; i++)
- {
- while (true)
- {
- string product = Console.ReadLine();
- if (product=="flour")
- {
- flour = true;
- }
- else if (product == "eggs")
- {
- eggs = true;
- }
- else if (product == "sugar")
- {
- sugar = true;
- }
- if (product == "Bake!")
- {
- if (flour && eggs && sugar)
- {
- Console.WriteLine($"Baking batch number {i}...");
- break;
- }
- else
- {
- Console.WriteLine("The batter should contain flour, eggs and sugar!");
- }
- }
- }
- flour = false;
- eggs = false;
- sugar = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement