Cod sursa(job #2029236)
Utilizator | Data | 29 septembrie 2017 18:43:48 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<fstream>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
int n,p,sum=1,k=1,i=5;
fin>>p;
while(true)
{
if(p==0)
{
fout<<k;
break;
}
if(i/5==p)
{
fout<<i;
break;
}else{i=i+5;}
}
}