Exemple #1
0
        public void Solve(ConsoleInput cin)
        {
            var A   = cin.ReadInt;
            var B   = cin.ReadInt;
            var C   = cin.ReadInt;
            var X   = cin.ReadInt;
            var ans = 0;

            for (int i = 0; i <= A; ++i)
            {
                for (int j = 0; j <= B; ++j)
                {
                    for (int k = 0; k <= C; ++k)
                    {
                        if (500 * i + 100 * j + 50 * k == X)
                        {
                            ans++;
                        }
                    }
                }
            }
            WriteLine(ans);
        }
Exemple #2
0
        public void Solve(ConsoleInput cin)
        {
            var s = cin.Read;

            WriteLine(s.Count(x => x == '1'));
        }