Cod sursa(job #1418553)
Utilizator | Data | 13 aprilie 2015 14:12:06 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
long long P;
int main()
{
int k=0,i,x=0;
f>>P;
f.close();
if (P%10 == 5) g<<-1<<'\n';
else if (P==0) g<<1<<'\n';
else
{for (i = 1;i <= P; i++)
{
k+=5;
}
g<<k<<'\n';
}
}