Пример #1
0
        static void Main(string[] args)
        {
            var inputFoods      = Console.ReadLine().Split();
            var happinessPoints = 0;

            foreach (var food in inputFoods)
            {
                var foodFactory = new FoodFactory(food);
                happinessPoints += foodFactory.GetFoodPoints();
            }

            var moodFactory = new MoodFactory(happinessPoints);

            Console.WriteLine(happinessPoints);
            Console.WriteLine(moodFactory.GetMood());
        }
Пример #2
0
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

        var sumHapinesPoints = 0;

        foreach (var item in input)
        {
            var foodFactory = new FoodFactory(item);
            sumHapinesPoints += foodFactory.GetFoodPoints(item);
        }

        var moodFactory = new MoodFactory(sumHapinesPoints);

        Console.WriteLine(sumHapinesPoints);
        moodFactory.GetMood(sumHapinesPoints);
    }