Cod sursa(job #778511)
Utilizator | George George92 | Data | 14 august 2012 22:10:11 |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.58 kb |
#include<stdio.h>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
int n,p,i=0,m;
f>>p;
n=1;
while(p!=i)
{
n++;
if(n%5==0)
{
m=n;
while(m%5==0)
{
i++;
m=m/5;
}
} }
g<<n;
f.close();
g.close();
}