Cod sursa(job #2480448)
Utilizator | Data | 25 octombrie 2019 17:08:35 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp-32 | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 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){
n += 5;
aux = n;
while(!(aux % 5)){
aux /= 5;
p--;
}
}
out << n;
return 0;
}