diff options
Diffstat (limited to '01_introductory_problems/trailing_zeros_1618.cpp')
| -rw-r--r-- | 01_introductory_problems/trailing_zeros_1618.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/01_introductory_problems/trailing_zeros_1618.cpp b/01_introductory_problems/trailing_zeros_1618.cpp new file mode 100644 index 0000000..04cf85b --- /dev/null +++ b/01_introductory_problems/trailing_zeros_1618.cpp | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #include <iostream> | ||
| 2 | |||
| 3 | int main() { | ||
| 4 | int n, c{0}; | ||
| 5 | std::cin >> n; | ||
| 6 | while (n > 0) | ||
| 7 | c += (n /= 5); | ||
| 8 | std::cout << c << std::endl; | ||
| 9 | } | ||
