Cod sursa(job #843615)

Utilizator hiticas_abelhiticasabel hiticas_abel Data 28 decembrie 2012 03:59:00
Problema Factorial Scor 25
Compilator cpp Status done
Runda 23dezile_2 Marime 0.45 kb
#include<fstream>
using namespace std;
int main()
{
    ifstream f("fact.in");
    ofstream g("fact.out");
    
    long p,x,zero=0;
    int i;
    
    f>>p;
    f.close();
    if(p==0)g<<"0\n";
    else
    
    for(i=5;i<=900000000;i+=5)
    {
            x=i;
            while(x%5==0)
              {zero++;x/=5;}            
          if(zero>=p) {g<<i<<"\n"; break;}
          
                 
    }
    
    
return 0;    
}