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