Cod sursa(job #2926313)
| Utilizator | Data | 17 octombrie 2022 17:46:34 | |
|---|---|---|---|
| Problema | Factorial | Scor | 10 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
#include <cmath>
int sf(int n){
int i = 1;
int s = 0;
while(floor(n/pow(5,i))){
s += floor(n/pow(5,i));
i++;
}
return s;
}
int main(){
int p, n = 0;
f >> p;
while(sf(n) != p) n++;
g << n;
f.close();
g.close();
return 0;
}
