Cod sursa(job #2178410)
| Utilizator | Data | 19 martie 2018 14:20:13 | |
|---|---|---|---|
| Problema | Factorial | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
long long p,po=10,s;
fin>>p;
if(p%10==5 && p!=0) {fout<<"-1";return 0;}
s=p*5;
while(po<=p){
s-=5;
po+=5;
}
fout<<s;
return 0;
}
