Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CaloriesCounter
- {
- class Program
- {
- static void Main(string[] args)
- {
- var productCount = int.Parse(Console.ReadLine());
- string product;
- var calls = 0;
- for (int i = 0; i <productCount; i++)
- {
- product = Console.ReadLine().ToLower();
- switch (product)
- {
- case "cheese": calls += 500; break;
- case "tomato sauce": calls += 150; break;
- case "salami": calls += 600; break;
- case "pepper": calls += 50; break;
- }
- }
- Console.WriteLine($"Total calories: {calls}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement