Cod sursa(job #2262249)
Utilizator | Data | 17 octombrie 2018 09:19:11 | |
---|---|---|---|
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 fin("fact.in");
ofstream fout("fact.out");
int main()
{
int n=0,P;
fin>>P;
if(P==0) fout<<1;
else
if(P>0)
{while(P!=0)
{
n=n+5;
P--;
}
fout<<n;}
else fout<<-1;
return 0;
}