Cod sursa(job #1194910)
| Utilizator | Data | 5 iunie 2014 11:16:58 | |
|---|---|---|---|
| Problema | Factorial | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
long long p,x=0;
f>>p;
while(p>0){
if(x%5==0&&x){
p-=x/5+1;
}
else p--;
x++;
}
if(!p) x*5;
else g<<-1;
return 0;
}
