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