Console.WriteLine("Введите первое слово:");
string word1 = Console.ReadLine();
Console.WriteLine("Введите второе слово:");
string word2 = Console.ReadLine();
Console.WriteLine("Введите третье слово:");
string word3 = Console.ReadLine();
string longest = word1;
string shortest = word1;
if (word2.Length > longest.Length)
longest = word2;
if (word2.Length < shortest.Length)
shortest = word2;
if (word3.Length > longest.Length)
longest = word3;
if (word3.Length < shortest.Length)
shortest = word3;
Console.WriteLine($"Самое длинное слово: {longest}");
Console.WriteLine($"Самое короткое слово: {shortest}");