Mai intai trebuie sa te autentifici.
Cod sursa(job #793229)
| Utilizator | Data | 2 octombrie 2012 12:55:47 | |
|---|---|---|---|
| Problema | Factorial | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
#include <iostream>
using namespace std;
long long p, s = 1, i = 1, cs, j;
int main ( void )
{
ifstream fin ( "fact.in" );
ofstream fout ( "fact.out" );
fin >> p;
while ( i )
{
j = 0;
s *= i;
//s /= 1000000;
//cout << s << '\n';
cs = s;
while ( cs % 10 == 0 )
{
j ++;
cs /= 10;
}
if ( j >= p )
{
fout << i;
break;
}
i ++;
}
fin.close();
fout.close();
}
