Cod sursa(job #1579206)
Utilizator | Data | 24 ianuarie 2016 15:35:16 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
int p,k,x=1,N=1,i=1;
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>p;
do
{
x=N*(N+1);
N++;
if(x%10==0)
k++;
}
while(k!=p);
fout<<N;
fin.close();
fout.close();
return 0;
}