Cod sursa(job #1433717)
Utilizator | Borozan Ionut Borozanionut | Data | 9 mai 2015 18:28:13 |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <stdio.h>
#include <fstream>
using namespace std;
int P,i,N,p,c,a;
int main()
{FILE *f1, *f2;
f1=fopen("fact.in","r");
f2=fopen("fact.out","w");
fscanf(f1,"%d", &P);
p=1;
if(P=0)
fprintf(f2,"%d", 1);
else
{for(i=1;i<5*P;i++)
{
p=p*i;
}
}
while(p!=0)
{ c=p%10;
p=p|10;
if(c=0)
{
a++;
}
}
if(a=P)
{fprintf(f2,"%d",5*P);
}
fclose(f1);fclose(f2);
return 0;
}