Cod sursa(job #2120584)
Utilizator | Data | 2 februarie 2018 17:43:55 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.23 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
long long x;
fin >> x;
if(!x)
fout << "1";
else
fout << ((x%5) ? (x-(x-1)/5)*5 : -1);
}