Advertisement
Guest User

Untitled

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