动态规划 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { String str = in.next(); int len = in.nextInt(); // 如果长度比字符串长,那数据有问题 if (len >= str.length()) { System.out.println(str); } else { maxSelect(str, l...