Advertisement
YavorGrancharov

Cake_Ingredients

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