Cod sursa(job #1592896)
Utilizator | Data | 8 februarie 2016 08:52:30 | |
---|---|---|---|
Problema | Factorial | Scor | 35 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
using namespace std;
#include <iostream>
#include <stdio.h>
#include <fstream>
int main(){
int n, copie, count = 0;
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
cin >> n;
for(int i = 5;;i+=5){
copie = i;
while(copie%5 == 0){
count++;
copie /= 5;
}
if(count == n){
cout<<i;
break;
}
}
return 0;
}