题解 | #HJ014 字符串排序#
字符串排序
http://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
import java.util.*;
/**
* HJ14 字符串排序
*/
public class HJ014 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.valueOf(sc.nextLine());
String[] array = new String[n];
for (int i = 0; i < n; i++) {
array[i] = sc.nextLine();
}
Arrays.sort(array);
for (String str : array) {
System.out.println(str);
}
sc.close();
}
}