viraco4a

07. Cake Ingredients

May 22nd, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 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 _07_Cake_Ingredients
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. for (int i = 0; ; i++)
  14. {
  15. string Ingredient = Console.ReadLine();
  16. if (Ingredient == "Bake!")
  17. {
  18. Console.WriteLine($"Preparing cake with {i} ingredients.");
  19. break;
  20. }
  21. Console.WriteLine($"Adding ingredient {Ingredient}.");
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment