Cod sursa(job #1994718)
Utilizator | Data | 25 iunie 2017 19:42:31 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream l("fact.out");
int p,n;
int main()
{
f>>p;
n=5*p-p/6*5;
p++;
if (n==5*p-p/6*5)
l<<-1;
else
l<<n;
return 0;
}