diff options
author | Jack Sangdahl <[email protected]> | 2025-02-13 15:18:28 -0700 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-02-13 15:18:28 -0700 |
commit | d5c06c689e3328546cd4c486b30a7909651501ed (patch) | |
tree | 0b2dc1900cc8a3f4da4e376fc24e5e6fc0c0b367 /introductory_problems/trailing_zeros.cpp | |
parent | 19bb82f44e8da0ab854f93248a8fe72d430b46e4 (diff) | |
download | cses-d5c06c689e3328546cd4c486b30a7909651501ed.tar.gz cses-d5c06c689e3328546cd4c486b30a7909651501ed.zip |
1618. trailing zeors
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); +} |