Advertisement
bacco

Cake Ingredients

May 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace gr
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var count = -1;    
  10.             for (int i = 0; i <= 20; i++)
  11.             {
  12.                 count++;
  13.  
  14.                 var a = Console.ReadLine();
  15.  
  16.                 if (a != "Bake!")
  17.                 {
  18.                     Console.WriteLine($"Adding ingredient {a}.");
  19.                 }
  20.                 else
  21.                 {
  22.                     Console.WriteLine($"Preparing cake with {count} ingredients.");
  23.                     break;
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement