Cod sursa(job #2261680)

Utilizator TeutschTeutsch Mihaly-Richard Teutsch Data 16 octombrie 2018 16:06:50
Problema Factorial Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <iostream>
#include <fstream>



using namespace std;



ifstream be("fact.in");
ofstream ki("fact.out");

int main()
{ int p,n,i=1;
be>>p;
be.close();
if(p==0) ki<<1;
n=5;
while(i<p){
    n=n+5;
    if(n%25==0) i=i+2;
    else i++;

}

if(i>p) ki<<-1;
else ki<<n;
ki.close();



}