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