const readline = require('readline');
const rl = readline.createInterface({input: process.stdin,output: process.stdout});
let surnames = [];
rl.question('Введите фамилии через пробел: ', (input) => {surnames = input.split(' ');
surnames.sort();
console.log('Отсортированные фамилии:');surnames.forEach((surname, index) => {console.log(${index + 1}. ${surname});});
rl.close();});
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let surnames = [];
rl.question('Введите фамилии через пробел: ', (input) => {
surnames = input.split(' ');
surnames.sort();
console.log('Отсортированные фамилии:');
surnames.forEach((surname, index) => {
console.log(${index + 1}. ${surname});
});
rl.close();
});