Cod sursa(job #2746835)
Utilizator | Data | 28 aprilie 2021 16:22:39 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main(){
int n,nr=0,rez=0;
in>>n;
while(rez!=n){
nr+=5;
int c=nr;
while(c%10==0){rez++;c/=10;}
while(c%5==0){rez++;c/=5;}
}
out<<nr;
}