Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. using System;
  2.  
  3. namespace forDouble8
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int numberOfBake = int.Parse(Console.ReadLine());
  10. string product = "";
  11. int counter = 0;
  12. int batchNumber = 0;
  13.  
  14. for (int i = 1; i <= numberOfBake; i++)
  15. {
  16.  
  17.  
  18. while (product != "Bake!")
  19. {
  20. product = Console.ReadLine();
  21.  
  22. if (product == "eggs")
  23. {
  24. counter++;
  25. }
  26. if (product == "sugar")
  27. {
  28. counter++;
  29. }
  30. if (product == "flour")
  31. {
  32. counter++;
  33. }
  34.  
  35. }
  36.  
  37. product = "";
  38.  
  39. if (counter >= 3)
  40. {
  41. batchNumber++;
  42. Console.WriteLine($"Baking batch number {batchNumber}...");
  43. }
  44. else
  45. {
  46. Console.WriteLine("The batter should contain flour, eggs and sugar!");
  47. numberOfBake++;
  48. }
  49.  
  50.  
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement