diff options
Diffstat (limited to 'cses/TrailingZeros/main.cpp')
| -rw-r--r-- | cses/TrailingZeros/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cses/TrailingZeros/main.cpp b/cses/TrailingZeros/main.cpp new file mode 100644 index 0000000..e41854e --- /dev/null +++ b/cses/TrailingZeros/main.cpp @@ -0,0 +1,15 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int n; + cin >> n; + int ans = 0; + for (int i = 5; n >= i; i *= 5) { + ans += n / i; + } + cout << ans << '\n'; +} |
