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