Cod sursa(job #2622333)
Utilizator | Data | 31 mai 2020 22:42:35 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
int long long p,n,aux=1,ok=0;
f>>p;
for(int i=1;i<=p;i++)
aux*=10;
cout<<aux<<endl;
n=1;
int x=2;
while(ok==0)
{
if(n%aux==0 && n%(aux*10)!=0)
{
ok=1;
}
else
{n=n*x;
x++;
}
}
g<<x-1;
}