目前只知道以下方法
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
for(int i = 1; i <= 5; ++i)
{
System.out.printf("请按回车继续");
System.in.read();
System.in.read();
System.out.println(i);
}
}
}