Как я могу проверить ввод консоли как целые числа?

Я написал свои коды и хочу проверить их таким образом, чтобы они позволяли вводить только промежуточные числа, а не алфавиты. Вот код, пожалуйста, я буду рад, если вы мне поможете. Спасибо.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace minimum
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = Convert.ToInt32(Console.ReadLine());
            int b = Convert.ToInt32(Console.ReadLine());
            int c = Convert.ToInt32(Console.ReadLine());

            if (a < b)
            {
                if (a < c)
                {
                    Console.WriteLine(a + "is the minimum number");
                }
            }
            if (b < a)
            {
                if (b < c)
                {
                    Console.WriteLine(b + "is the minimum number");
                }
            }
            if (c < a)
            {
                if (c < b)
                {
                    Console.WriteLine(c + "is the minimum number");
                }
            }


            Console.ReadLine();
        }
    }
}
9
задан razlebe 26 January 2011 в 13:32
поделиться