Cod sursa(job #372094)
Utilizator | Data | 8 decembrie 2009 19:25:39 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fi("fact.in");
ofstream fo("fact.out");
int p,i,j,p2,k;
int main(){
fi>>p;
for(j=p;j<=p+k;j++){
p2=j/5+j/25+j/125+j/625+j/3125+j/15625+j/78125;
if(p==p2) {
fo<<j;
break;
}else k++;
}
}