

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
#include <iostream>
#include <cmath>
using namespace std;
int countZeros(int n)
{
// Initialize result
int count = 0;
// Keep dividing n by powers
// of 5 and update count
for (int i=5; n/i>=1; i *= 5)
count += n/i;
return count;
}
// Driver code
int main()
{
int n;
cin >> n;
cout << countZeros(n);
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
Bảng tin