输出
hello
woow
题目答案:
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int line = scanner.nextInt();
scanner.nextLine();
for (int i = 0; i < line; i++) {
System.out.println(scanner.nextLine().replaceAll("(.)\\1+","$1$1").replaceAll("(.)\\1(.)\\2","$1$1$2"));
}
}
}