1.N的阶乘,末尾0的个数
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
void nStepMultiply(int Num) { int result = 0; while (Num) { result += Num / 5; Num /= 5; } cout << result << endl; }
2.N的阶乘,二进制中的最后一个1的位置
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
int positionOfLastOne(int Num) { int result = 1; while (Num) { result += Num / 2; Num /= 2; } return result; }