示例#1
0
        /// <summary>
        /// Reads the data from the <see cref="Console"/> until an empty line is reached.
        /// </summary>
        public void Read()
        {
            CanSolve = IsSolved = false;
            m_Rows.Clear();
            string input;

ReadInput:
            input = System.Console.ReadLine();
            if (string.IsNullOrWhiteSpace(input))
            {
                CanSolve = true;
                return;
            }
            string[] values = input.Split(" ");
            int      seating;
            Row      row = new Row();

            foreach (string value in values)
            {
                if (int.TryParse(value, out seating))
                {
                    row.AddSection(seating);
                }
            }
            m_Rows.Add(row);
            goto ReadInput;
        }