Advertisement
Yanislav29

Untitled

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