Cod sursa(job #13434)
Utilizator | Data | 6 februarie 2007 17:50:22 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
using namespace std;
int n,p,m;
int main()
{
ifstream in("fact.in");
in>>p;
n=5;
p--;
while(p)
{
n=n+5;
m=n;
while(m%5==0)
{
p--;
m=m/5;
}
}
ofstream out("fact.out");
out<<n;
return 0;
}