ss3434

бисквити

Oct 22nd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 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 _8._1_Фабрика_за_бисквити
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int numberOfBake = int.Parse(Console.ReadLine());
  15. string product = "";
  16. bool countf = false;
  17. bool counte = false;
  18. bool counts = false;
  19. int batchNumber = 0;
  20.  
  21. for (int i = 1; i <= numberOfBake; i++)
  22. {
  23.  
  24.  
  25. while (product != "Bake!")
  26. {
  27. product = Console.ReadLine();
  28.  
  29. if (product == "eggs")
  30. {
  31. countf = true;
  32. }
  33. if (product == "sugar")
  34. {
  35. counte = true;
  36. }
  37. if (product == "flour")
  38. {
  39. counts = true;
  40. }
  41.  
  42. }
  43.  
  44. product = "";//zanulqvame produkta;
  45.  
  46.  
  47. if ((countf) && (counte) && (counts))
  48. {
  49. batchNumber++;
  50. Console.WriteLine($"Baking batch number {batchNumber}...");
  51. }
  52. else
  53. {
  54. Console.WriteLine("The batter should contain flour, eggs and sugar!");
  55. numberOfBake++;
  56. }
  57. }
  58. }
  59. }
  60. }
Add Comment
Please, Sign In to add comment