Cod sursa(job #903959)

Utilizator CybiliniRadulescu Serban-Petru Cybilini Data 3 martie 2013 14:52:33
Problema Factorial Scor 15
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
long long na,b,c,a,m,P,i;
int main()
{ f>>P;
na=1;
if (P==0) g<<1;
else    {//if (P>=1000000){na=4000004;c=999999;}
 for (i=5;c!=P;i=i+5)  {m=i;
 while (m%5==0) {c++;m=m/5;}
}}
g << i-5;
    return 0;
}