Cod sursa(job #2554955)
Utilizator | Data | 23 februarie 2020 15:40:31 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp-32 | Status | done |
Runda | Arhiva de probleme | Marime | 0.23 kb |
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int p, n;
in >> p;
n = p * 5;
if (p == 0)
out << 1;
else if (p < 0)
out << -1;
else
out << n;
}