package try1;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class answer {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
Queue<String> q = new LinkedList<>();
for (int i = 0; i < x; i++) {
int a = sc.nextInt();
String[] s = new String[a];
int b = sc.nextInt();
for (int j = 0; j < s.length; j++) {
s[j] = sc.next();
}
String[] n = dd(s, b);
for (int j = 0; j < n.length; j++) {
q.offer(n[j]);
}
}
for (String string : q) {
System.out.println(string);
}
}
static String[] dd(String[] s, int b) {
String a = "->";
String[] n = new String[s.length];
String m = new String();
for (int i = 0; i < b; i++) {
m += " ";
}
for (int i = 0; i < s.length; i++) {
if (s[i].contains(a)) {
s[i] = s[i].replaceAll(a, m);
}
n[i] = s[i];
}
return n;
}
}
转载请注明原文地址:https://blackberry.8miu.com/read-822.html