Cod sursa(job #659918)
Utilizator | Data | 11 ianuarie 2012 11:21:23 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<fstream>
using namespace std;
int main( )
{long P;
int N,b,e;
ifstream f("fact.in");
ofstream h("fact.out");
f>>P;
if(P==0)
N=1;
N=5;e=0;
do
{N=N+5;
b=N;
while(b%5==0)
{e=e+1;
b=b/5;}}
while(e!=P);
h<<N;
f.close( );
h.close( );
return 0;}