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 _08.Calories_Counter
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int callories = 0;
- for (int i = 0; i < n; i++)
- {
- string ingredients = Console.ReadLine().ToLower();
- switch(ingredients)
- {
- case "cheese":
- callories += 500;
- break;
- case "tomato sauce":
- callories += 150;
- break;
- case "salami":
- callories += 600;
- break;
- case "pepper":
- callories += 50;
- break;
- default:
- break;
- }
- }
- Console.WriteLine($"Total calories: {callories}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement