package com.patience.interview.huawei;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/**
* 字符串排序
* @author Green.Gee
* @date 2022/7/28 18:32
* @email green.gee.lu@gmail.com
*/
public class SortOfTheString {
public static void main(String[] args) throws Exception{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String n = in.readLine();
List<String> list = new ArrayList<>();
int num = Integer.valueOf(n);
for(int i = 0; i < num; i++){
String item = in.readLine();
list.add(item);
}
list.sort((k1,k2) -> {
return k1.compareTo(k2);
});
list.forEach(System.out::println);
}
}
字符串排序_acill排序
最新推荐文章于 2024-08-30 18:40:43 发布