在我的OS X电脑上,以下代码可以给我提供一种简单易用的方式来追踪循环的状态:
On my OS X machine, the following line gives me a nice and easy way to track the state of my loops:
for (int index = 0; index < 100; index++)
for (int subIndex = index; subIndex < 100; subIndex++)
System.out.print("\r" + index + "/" + subIndex + " ");
但是当我在Windows上尝试运行相同的代码时,它会输出换行符而不是回车符。我该如何在Windows上实现与此类似的简单进程跟踪方法呢?