Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Numerics;
- namespace Problem_13.Trailing_Zeroes_in_N_
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- BigInteger fact = 1;
- for (int i = 1; i <= n; i++)
- {
- fact *= i;
- }
- bool end = true;
- int zeros = 0;
- while(end == true)
- {
- if(fact % 10 == 0)
- {
- fact /= 10;
- zeros++;
- }
- else
- {
- end = false;
- }
- }
- Console.WriteLine(zeros);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement