Cod sursa(job #544396)

Utilizator fhandreiAndrei Hareza fhandrei Data 1 martie 2011 15:59:53
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include <stdio.h>
int n, nr0,i2;
int i; // Contor
FILE *in, *out;
int main(void)
{
    in=fopen("fact.in","rt");
    out=fopen("fact.out","wt");
    for(i=1;i<=n;i++)
    {
        i2=i;
        while( !(i2%5) )
        {
            nr0++;
            i2/=5;
        }
    }
    fprintf(out, "%d",nr0);

    fclose(in);
    fclose(out);
    return 0;
}