Cod sursa(job #1180190)
Utilizator | Data | 30 aprilie 2014 02:12:40 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f;
ofstream g;
main()
{
f.open("fact.in");
g.open("fact.out");
unsigned long a,p,b,c;
f>>p;
b=0;
c=1;
a=1;
while(b!=p)
{
a=a*c;
c=c+1;
if(a%10==0){b++;a=a/10;}
}
g<<c;
f.close();
g.close();
}