Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Cake_Ingredients
- {
- class Cake_Ingredients
- {
- static void Main(string[] args)
- {
- int count = 0;
- for (int i = 0; i < 20; i++)
- {
- string ingredient = Console.ReadLine();
- if (ingredient.Length <= 50)
- {
- if (ingredient != "Bake!")
- {
- Console.WriteLine($"Adding ingredient {ingredient}.");
- count++;
- }
- else break;
- }
- }
- Console.WriteLine($"Preparing cake with {count} ingredients.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement