DonJabone

FactorielZeros

May 27th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2.  
  3. class FactorielZeros
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("n = ");
  8.         int n = int.Parse(Console.ReadLine());
  9.         int j = 5;
  10.         int nulls = 0;
  11.         for (int i = 1; j > 1 ; i++)
  12.         {
  13.             j = n/ (int)Math.Pow(5 , i);
  14.             nulls += j;
  15.         }
  16.         Console.WriteLine("In {0}! have {1} nulls" , n , nulls);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment