Cod sursa(job #2149307)
Utilizator | Data | 2 martie 2018 14:53:11 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int a=1,i,p,c=1;
long long s=1;
int main()
{
f>>p;
for(i=1;i<=p;i++)
a*=10;
while(s%a!=0)
{
s*=c;
c++;
}
g<<c-1;
return 0;
}