Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int counter = 0;
- while (true)
- {
- string inputIngredient = Console.ReadLine();
- if(inputIngredient == "Bake!")
- {
- Console.WriteLine($"Preparing cake with {counter} ingredients.");
- break;
- }
- else
- {
- Console.WriteLine($"Adding ingredient {inputIngredient}.");
- counter++;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement