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);
}
}