Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long ans = 0;
- int func(int num) {
- if (num % 5 == 0) {
- ans++;
- return func(num / 5);
- }
- }
- int main() {
- long long n, i, temp;
- cin >> n;
- for (i = 1; i <= n; i++) {
- temp = func(i);
- }
- cout << ans << '\n';
- return 0;
- }
Add Comment
Please, Sign In to add comment