Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ΠΡΠΏΠ°
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- var calories = 0;
- for (int i = 0; i < n; i++)
- {
- var ingredient = Console.ReadLine().ToLower();
- if (ingredient == "cheese")
- {
- calories += 500;
- }
- else if (ingredient == "tomato sauce")
- {
- calories += 150;
- }
- else if (ingredient == "salami")
- {
- calories += 600;
- }
- else if (ingredient == "pepper")
- {
- calories += 50;
- }
- }
- Console.WriteLine($"Total calories: {calories}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement