Cod sursa(job #2077827)
Utilizator | Data | 28 noiembrie 2017 17:44:47 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int main()
{
int P,n,contor,i,ci,k;
fin>>P;
contor=0;
i=5;
while (contor<P)
{
if (k%5==0)
contor++;
contor++;
k++;
i+=5;
}
if (contor==P)
fout<<i-5;
else
fout<<-1;
return 0;
}