Cod sursa(job #638867)
Utilizator | Data | 21 noiembrie 2011 19:55:09 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
using namespace std;
int n,k,i,j;
int main()
{ifstream in ("fact.in");
in>>n;
int i=0,j=0;
while (i!=n)
{
j=5+j;
k=j;
while (k%5==0)
{
k=k/5;
i=1+i;
}
}
ofstream out ("fact.out");
out <<j;
return 0;
}