Cod sursa(job #1423096)
Utilizator | Data | 21 aprilie 2015 13:18:21 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int a;
int e=0;
long long x=0;
int p;
fin>>p;
while(e<p)
{
x+=5;
a=x;
while(a%5==0)
{
e++;
a/=5;
}
}
fout<<x;
}