62,628
社区成员
发帖
与我相关
我的任务
分享
public class Test{
public static void main(String[] args){
String content = "aaabccddd";
String temp = "";
boolean flag = true;
while(flag){
temp = content.replaceAll("(.)\\1","");
if(temp.equals(content)){
flag = false;
}else{
content = temp;
}
}
System.out.println(content);
}
}