public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
System.out.print(line);
scanner.close();
for (int i = 0; i < 3; i++) {
new Print(i, "_" + (char)('A' + i)).start();
}
}
}
class Print extends Thread {
public static volatile int flag = 0;
private int id;
private String val;
public Print(int id, String val) {
this.val = val;
this.id = id;
}
@Override
public void run() {
while (true) {
if (id == flag) {
System.out.print(val);
flag++;
return;
}
}
}
}
没超时,通过