Cod sursa(job #1111300)
Utilizator | Data | 18 februarie 2014 19:38:38 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{ int p,c1;
f>>p;
if(p%6==5) g<<"-1";
if(p==0) g<<"1";
else
{c1=p/6;
p=p-c1;
g<<5*p;}
return 0;
}