Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class TrailingZeroInN
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int zeroCounter = 0;
- int divider = 5;
- while (n / divider >= 1)
- {
- zeroCounter += n / divider;
- divider *= 5;
- }
- Console.WriteLine(zeroCounter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement