Cod sursa(job #1113662)
Utilizator | Data | 20 februarie 2014 19:57:41 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <fstream>
using namespace std;
int main () {
ifstream f("fact.in");
ofstream g("fact.out");
int n, i=1, q=0, p=1;
f>>n;
while (n>q){
p=i;
while (p%5==0){
q++;
p=p/5;
}
i++;}
g<<i-1; }