Cod sursa(job #188611)
Utilizator | Data | 9 mai 2008 11:54:44 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
long long int P,p,nr,ind;
int main(){
fin >> P;
while(p<P){
nr+=5;
ind=nr;
while (ind%5==0){
ind=ind/5;
p++;
}
}
fout << nr;
fin.close();
fout.close();
}