private static void Main(string[] args) { char minChar, maxChar; try { Write("Enter min char: "); minChar = Convert.ToChar(ReadLine()); Write("Enter max char: "); maxChar = Convert.ToChar(ReadLine()); var latinChar = new LatinChar(); for (; minChar <= maxChar; minChar++) { latinChar.Char = minChar; WriteLine(latinChar.Char); } } catch (Exception exception) { WriteLine($"Error: {exception.Message}"); } ReadKey(); }
static void Main(string[] args) { char minChar; char maxChar; while (!char.TryParse(Console.ReadLine(), out minChar) || !char.TryParse(Console.ReadLine(), out maxChar) || minChar < 'a' || minChar > 'z' || maxChar < 'a' || maxChar > 'z') { ; } for (char i = minChar; i <= maxChar; i++) { LatinChar charClass = new LatinChar(i); Console.Write(charClass.Char + " "); } }
static void Main(string[] args) { Console.Write("Введите минимальный символ: "); if (!char.TryParse(Console.ReadLine(), out char min)) { Console.WriteLine("Incorrect input"); } Console.Write("Введите ммаксимальный символ: "); if (!char.TryParse(Console.ReadLine(), out char max)) { Console.WriteLine("Incorrect input"); } LatinChar A; for (char i = min; i <= max; i++) { A = new LatinChar(i); Console.WriteLine(A.ToString()); } }