Cod sursa(job #1502271)

Utilizator OFY4Ahmed Hamza Aydin OFY4 Data 14 octombrie 2015 14:58:13
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream>
using namespace std;
main(){

    ifstream fin("fact.in");
    ofstream fout("fact.out");

    int ofya=-1,p;
    fin>>p;

    unsigned long long int f=6,i=5;

    while(ofya==-1){

        f*=i;
        i+=5;

        if(f%(10*p)==0)ofya=1;
    }

    fout<<i;
}