Cod sursa(job #729445)
Utilizator | Data | 29 martie 2012 16:33:52 | |
---|---|---|---|
Problema | Factorial | Scor | 35 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include<fstream>
using namespace std;
int n,s,p,cn;
int main(){
ifstream in("fact.in");
ofstream out("fact.out");
in>>p;
n=5;
do {
cn=n;
while(n%5==0){
s++;
n=n/5;
}
n=cn;
n=n+5;
}while(s<p);
out<<n-5;
return 0;
}