Pagini recente » Rating Berceanu Viorel (bumbacea_v) | Cod sursa (job #1034219) | Cod sursa (job #2097279) | Cod sursa (job #3287556) | Cod sursa (job #350166)
Cod sursa(job #350166)
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream f;f.open("fact.in");
ofstream g;g.open("fact.out");
unsigned long int n,aux,nr,a,b;
f>>n;
while(n!=0)
{
f>>nr;
a=0;
b=0;
while(b<nr)
{a=a+5;
aux=a;
while(aux!=0)
{if(aux%5==0)
b++;
aux=aux/5;}
}
if(b==nr) g<<a<<endl;
else g<<"-1"<<endl;
n--;
}
g.close();
f.close();
return 0;
}