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