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