Cod sursa(job #2480452)
| Utilizator | Data | 25 octombrie 2019 17:11:10 | |
|---|---|---|---|
| Problema | Factorial | Scor | 20 |
| Compilator | cpp-32 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int p, n = 0, aux;
int main(){
in >> p;
while(p > 0){
n += 5;
aux = n;
while(!(aux % 5)){
aux /= 5;
p--;
}
}
out << n;
return 0;
}
