public class OrderWord {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
List<String> li=new ArrayList<String>();
System.out.println("输入一个整数:");
int n;
n=sc.nextInt();
System.out.println("输入"+n+"个单词:");
for(int i=0;i<n;i++){
String word=sc.next();
li.add(word);
}
Collections.sort(li);
for(String s:li)
System.out.println(s);
}
}