Advertisement
VelizarAvramov

07. Cake Ingredients

Nov 9th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _07._Cake_Ingredients
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string ingredient = Console.ReadLine();
  10.  
  11.             int count = 0;
  12.  
  13.             while (ingredient != "Bake!")
  14.             {
  15.                 Console.WriteLine($"Adding ingredient {ingredient}.");
  16.                 ingredient = Console.ReadLine();
  17.                 count++;
  18.             }
  19.             Console.WriteLine($"Preparing cake with {count} ingredients.");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement