BubaLazi

07.CakeIngrediants

May 30th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 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 Competitions
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var ingredient = Console.ReadLine();
  14.             var count = 0;
  15.            
  16.             do
  17.             {
  18.                 Console.WriteLine($"Adding ingredient {ingredient}.");
  19.                 ingredient = Console.ReadLine();
  20.                 count++;
  21.  
  22.             }
  23.             while (ingredient != "Bake!");
  24.  
  25.             Console.WriteLine("Preparing cake with {0} ingredients.", count);
  26.  
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment