Advertisement
Guest User

Untitled

a guest
Apr 13th, 2019
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _08.Cookie_factory
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int batch = int.Parse(Console.ReadLine());
  14. string comand = string.Empty;
  15. int counter = 0;
  16.  
  17. for (int i = 1; i <= batch; i++)
  18. {
  19. while (comand != "Bake!" || i <= batch)
  20. {
  21. comand = Console.ReadLine();
  22. if (comand == "flour" || comand == "eggs" || comand == "sugar")
  23. {
  24. counter++;
  25. }
  26. if (counter < 3 && comand == "Bake!")
  27. {
  28. Console.WriteLine("The batter should contain flour, eggs and sugar!");
  29. }
  30. else if (comand == "Bake!")
  31. {
  32. Console.WriteLine($"Baking batch number {i}...");
  33. break;
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement