Cod sursa(job #1060544)
Utilizator | Data | 18 decembrie 2013 07:30:05 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <fstream>
using namespace std;
int main()
{
ifstream f("fact.in");
long long n=0,i=1,p,y=1;;
ofstream g("fact.out");
f>>p;
while(n<p)
{
i++;
y=y*i;
while(y%10==0){n++;y=y/10;}
y=y%100;
}
g<<i;
f.close();
f.close();
return 0;
}