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