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