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