Cod sursa(job #1366979)

Utilizator T3CUTeculescu Andrei T3CU Data 1 martie 2015 15:17:54
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include<fstream>
using namespace std;
int main ()
{int c=1 ,nr=1, p ,b=2, a=1;
long n=1;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
while (p!=0)
{a=a*10; p--;}
while (n%a!=0)
{n=b*n; b++; nr++; }
g<<nr;
f.close();
g.close();
}