Cod sursa(job #1173691)
Utilizator | Data | 20 aprilie 2014 17:30:36 | |
---|---|---|---|
Problema | Factorial | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <fstream>
using namespace std;
int main () {
ifstream f("fact.in");
ofstream g("fact.out");
int n, s=0, c=5, t=0;
f>>n;
if(n==0) g<<1;
else
{while(s<n){
t=c;
while(t%5==0){
t=t/5;
s++;
}
c=c+5;
}
g<<c-5;
f.close();
g.close();
}}