string[] words = new string[3];
// Ввод трех слов
for (int i = 0; i < 3; i++)
{
Console.Write($"Введите слово {i + 1}: ");
words[i] = Console.ReadLine();
}
// Поиск самого длинного и короткого
string longest = words[0];
string shortest = words[0];
foreach (string word in words)
{
if (word.Length > longest.Length)
longest = word;
if (word.Length < shortest.Length)
shortest = word;
}
// Вывод результата
Console.WriteLine($"\nСамое длинное слово: {longest} ({longest.Length} букв)");
Console.WriteLine($"Самое короткое слово: {shortest} ({shortest.Length} букв)");