Cod sursa(job #2198176)

Utilizator VoksiSolomon Ionut Voksi Data 23 aprilie 2018 20:19:01
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include <iostream>
#include <fstream>
using namespace std;

int main(){
    int n = 1, put = 0, p;
    ifstream i("fact.in");
    ofstream o("fact.out");
    i>>p;
    do{
        if(n%5 == 0)
        if(n/5 == 5)
            put += 2;
        else put++;
        ++n;
    }while(put< p);
        if(put == p)
    o<<n-1;
    else o<<"-1";
}