Cod sursa(job #369549)
Utilizator | Data | 28 noiembrie 2009 18:09:59 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
int p,n=0,e;
FILE *fin=fopen("fact.in","r");
fscanf(fin,"%d",p);
FILE *fout=fopen("fact.out","w");
if(p==0)n=1;
while(p)
{
n+=5;e=n;
while(e%5==0)e/=5,p--;
}
fprintf(fout,"%d",n);
fout.close();
return 0;
}