Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- long num = long.Parse(Console.ReadLine());
- long zeroSum = 0;
- long k = 1;
- while (Math.Pow(5, k) < num)
- {
- long powResult = (long)Math.Pow((double)5, k);
- zeroSum += num / powResult;
- k++;
- }
- Console.WriteLine("Number of zeros: {0}", zeroSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement