Guest User

Cake

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