Cod sursa(job #1501419)
Utilizator | Data | 13 octombrie 2015 13:45:11 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<fstream>
using namespace std;
int main(){
ifstream fin("fact.in");
ofstream fout("fact.out");
int i=1,s=1,n,ofya=-1,b=0;
fin>>n;
while(ofya==-1){
s=s*i;
b=0;
for(int j=0;j<n;++j){
if(s%10==0){
++b;
}
}
++i;
if(b==n){
ofya=1;
}
}
fout<<i;
}