Ejemplo n.º 1
0
        static void Main()
        {
            List <string> input = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToList();
            List <Food>   menu  = new List <Food>(input.Count);

            input.ForEach(x => menu.Add(FoodFactory.GetFood(x)));
            int points = menu.Sum(x => x.MoodValue);

            Console.WriteLine(points);
            Console.WriteLine(MoodFactory.GetMood(points));
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            var input     = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int allPoints = 0;

            for (int i = 0; i < input.Length; i++)
            {
                allPoints += FoodFactory.GetPoints(input[i].ToLower());
            }

            Console.WriteLine(allPoints);
            Console.WriteLine(MoodFactory.GetMood(allPoints));
        }