Advertisement
Guest User

Untitled

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