Cod sursa(job #1106067)

Utilizator stefy9815Nicula Stefan Dorin stefy9815 Data 12 februarie 2014 13:53:27
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
    int p,n,i,s,j,k;
    f>>p;
    for(n=1;k==0 && n>0;n++)
    {
        p=n;
        while(p%5==0)
            if(p%5==0)
            {
                i++;
                p=p/5;
            }
        if(i>=p)
            s=n;
    }
    if(i!= p)
        g<<"-1";
	else g<<s;

    return 0;
}