Cod sursa(job #1599829)
Utilizator | Data | 14 februarie 2016 14:08:10 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <fstream>
using namespace std;
int n,p,i,k=1,h,j;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{fin>>p;
if(p==0)fout<<"1";
else{
for(i=1;i<=p;i++)
{h=h+5;
j=h/5;
if(j%5==0 && j!=0 )
{i++;}
}
fout<<h;
}
return 0;
}