diff options
Diffstat (limited to 'introductory_problems/trailing_zeros.cpp')
-rw-r--r-- | introductory_problems/trailing_zeros.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/introductory_problems/trailing_zeros.cpp b/introductory_problems/trailing_zeros.cpp new file mode 100644 index 0000000..02fff6f --- /dev/null +++ b/introductory_problems/trailing_zeros.cpp @@ -0,0 +1,13 @@ +// 1618. Trailing Zeros +#include <bits/stdc++.h> +using namespace std; + +int main() { + static int n, ans; + scanf("%d", &n); + while (n) { + n /= 5; + ans += n; + } + printf("%d\n", ans); +} |