在我的 OS X 机器上,以下行为我提供了一种很好且简单的方法来跟踪我的循环状态:
for (int index = 0; index < 100; index++)
for (int subIndex = index; subIndex < 100; subIndex++)
System.out.print("\r" + index + "/" + subIndex + " ");
但是当我尝试在 Windows 上运行相同的东西时,它会打印出换行符而不是回车符。如何实现在 Windows 上跟踪进程的相同简单方法?