コード例 #1
0
        private static void Task5()
        {
            var foodData = Console.ReadLine().Split(new string[] { ", ", " " }, StringSplitOptions.RemoveEmptyEntries);

            var happinesPoints = 0;

            foreach (var foodName in foodData)
            {
                var food = FoodFactory.Get(foodName);
                happinesPoints += food.Points;
            }

            var mood = MoodFactory.Get(happinesPoints);

            Console.WriteLine(happinesPoints + Environment.NewLine + mood.Name);
        }