题解 | #字符串排序#
字符串排序
http://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
import java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
ArrayList array=new ArrayList();
int n=0;
n=sc.nextInt();
for(int i=1;i<=n;i++){
array.add(sc.next());
}
Collections.sort(array);
for(String m:array){
System.out.println(m);
}
}
}