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