Cod sursa(job #1994720)
Utilizator | Data | 25 iunie 2017 19:45:48 | |
---|---|---|---|
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");
long long 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;
}