Cod sursa(job #1438836)
Utilizator | Data | 20 mai 2015 23:15:18 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main() {
int p;
fin>>p;
if(p==0)
fout<<1;
else if(p<=4)
fout<<5*p;
else if(p==5)
fout<<"-1";
else if(p>5)
fout<<5*(p-1);
return 0;
}