如果你第二个点过不去,显示 The final state is wrong.,检查一下哪个循环头写错了。 比如我把 for(int j=i+1;j<=n+1;++j) 写成了 for(int j=i+1;j<=n;++j),导致没有交换最后一个数字。
The final state is wrong.
for(int j=i+1;j<=n+1;++j)
for(int j=i+1;j<=n;++j)