Cod sursa(job #1582278)
Utilizator | Data | 27 ianuarie 2016 19:49:53 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int p;
void read ()
{
fin>>p;
}
void fact ()
{
int n=1, d=1;
do
{
n*=d;
d++;
} while ((n/(p*10))%10==0);
fout<<n;
}
int main()
{
read();
fact();
return 0;
}