从字符串的角度出发,用的是最简单的数据结构,简单易懂 public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); while (scn.hasNext()) { String str = scn.next(); String s = ""; //以三位为一段从后往前取子串 String result = ""; int i = str.length(); int flag = 0;//flag用于记录计数单位 do { int start, end; sta...