Advertisement
Guest User

Untitled

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