Cod sursa(job #1501437)
Utilizator | Data | 13 octombrie 2015 13:57:48 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include<iostream>
#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,temp;
fin>>n;
while(ofya==-1){
s=s*i;
b=0;
temp=s;
for(int j=0;j<n;++j){
if(b==n)break;
if(temp%10==0){
++b;
}
temp/=10;
}
++i;
if(b==n){
ofya=1;
}
}
fout<<i;
}