Cod sursa(job #365892)
Utilizator | Data | 20 noiembrie 2009 09:19:24 | |
---|---|---|---|
Problema | Factorial | Scor | 45 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main() {
int i, j, n, p;
fstream f1, f2;
f1.open("fact.in", ios::in);
f1>>p;
f1.close();
j=0; i=5;
while(j<p) {
n=i;
while(n%5==0) {
j++;
n/=5;
}
i+=5;
}
f2.open("fact.out", ios::out);
f2<<i-5<<endl;
f2.close();
return 0;
}