考虑一下您在此循环中运行了多少次。看起来像
(size!) / (size - n)!:
int numLoops = 1;for (int i = 0; i < n; i++) { numLoops*= (size - i);}for (int i = 0; i < numLoops; i++) { //do something}
考虑一下您在此循环中运行了多少次。看起来像
(size!) / (size - n)!:
int numLoops = 1;for (int i = 0; i < n; i++) { numLoops*= (size - i);}for (int i = 0; i < numLoops; i++) { //do something}