In this question, it should be noted that not only n/5, but also the case where n/5 is a multiple of 5, you must continue to n/5. For example, 25/5=5, then this 5 should also be taken into account.
code show as below:
#include <iostream>
using namespace std;
int trailingZeroes(int n) {
int count=0;
while(n) {
n/=5;
count+=n;
}
return count;
}
int main()
{
cout<<trailingZeroes(25)<<endl;
return 0;
}