Cod sursa(job #1926866)
Utilizator | Data | 14 martie 2017 19:00:32 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("fact.in");
ofstream g("fact.out");
int n=0 ,p;
f>>p;
if(p==0)
g<<"1";
else
{
for(int i=1; i<=p; i++)
{
n=n+5;
if(i%5==0)
i++;
}
g<<n;
}
return 0;
}