Code for USACO practice problems
cpp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
346 B

#include <cmath>
#include <iostream>
using namespace std;
int main() {
long n;
cin >> n;
int a;
/* a += floor(n / 5);
a += floor(n / 25);
a += floor(n / 125);
a += floor(n / 625);
a += floor(n / 3125);
a += floor(n / 15625);*/
for (int i = 0; i < 100; i++) {
a += floor(n / pow(5, i + 1));
}
cout << a;
}