Cod sursa(job #2077833)
Utilizator | Data | 28 noiembrie 2017 17:47:49 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int p,n,c=0,ok=1,i;
in>>p;
i=1;
while(c>=p&&ok==1)
{
c=0;
if(i%5==0)
while(i%5==0)
{
c++;
}
i=i+5;
if(c==p)
{n=i;ok=0;}
}
out<<n;
return 0;
}