Cod sursa(job #1482439)

Utilizator stefanvdpruna stefan stefanvd Data 7 septembrie 2015 10:38:07
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <fstream>
using namespace std;
int k,p,i,x,a;
int main()
{
    ifstream f("factorial.in");
    ofstream g("factorial.out");
    f>>p;
    while(k<p)
    {a++;
        i++;
        x=i;
        if(x%5==0)
        {k++;
        while((x/5)%5==0)
        k++;}
    }
    if(p==0) g<<1; else
    g<<a;
    return 0;
}