Cod sursa(job #843997)

Utilizator hiticas_abelhiticasabel hiticas_abel Data 28 decembrie 2012 18:11:53
Problema Factorial Scor 40
Compilator cpp Status done
Runda 23dezile_2 Marime 0.36 kb
#include<fstream>
#include<math.h>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{   
  long n,k,i,h;
    f>>n;
    k=0;
    for(i=5;k<n;i=i+5)
        {
        k++;
      h=i/5;
        while(h%5==0)
            {
            k++;
            h=h/5;
            }
        }
    g<<i-5;
    return 0;
    }