Cod sursa(job #1919465)
Utilizator | Data | 9 martie 2017 19:36:23 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
long long p,n,ni=1,r=1;
f>>p;
if(p==0)g<<1;
else
{
n=p*5;
while(ni*5<=n)
{
n+=r;r++;
}
g<<n;
}
}