diff --git a/README.md b/README.md new file mode 100644 index 0000000..e7417b9 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Solution to the second Problem + +hope shabd improves his movie taste tho :) diff --git a/question-2/solution-2.cpp b/question-2/solution-2.cpp new file mode 100644 index 0000000..88aa59e --- /dev/null +++ b/question-2/solution-2.cpp @@ -0,0 +1,27 @@ +#include +using namespace std; + +int count_trailing_zeroes(int n) { + int zeroes = 0; + int i = 5; + while (n / i > 0) { + zeroes += n / i; + i *= 5; + } + return zeroes; +} + +int main() { + int t; + cin >> t; // Input number of test cases + + while (t>0) { + int n; + cin >> n; // Input number n + // Output + cout << count_trailing_zeroes(n) << endl; + t--; + } + + return 0; +}