Cod sursa(job #1516517)

Utilizator dragos231456Neghina Dragos dragos231456 Data 3 noiembrie 2015 09:25:40
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    int p,n,t;
    ifstream f("fact.in");
    ofstream g("fact.out");
    f>>p;
    n=0;
    t=-1;
    if(p!=0)
    while(t!=p)
    {
        if(n%5==0) t+=1;
        if(t==p) break;
        else n+=1;
    }
    else n=1;
    g<<n;
}