Cod sursa(job #2282618)
Utilizator | Data | 14 noiembrie 2018 10:20:02 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
#include<iostream>
using namespace std;
ifstream f("fact.in");
ofstream o("fact.out");
int n, k=1, a=5;
void citire(){
f>>n;
}
int h5(int x){
int g=0;
while(x!=0 && x%5==0){
g++;
x=x/5;
}
return g;
}
void prel(){
while(k!=n){
k+=h5(a);
a+=5;
}
}
void afisare(){
o<<a;
}
int main(){
citire();
prel();
return 0;
}