Cod sursa(job #1121868)
Utilizator | Data | 25 februarie 2014 14:32:36 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int n,k;
unsigned long long x,y;
int main()
{f>>n;
x=1;
while(k<n)
{y=x;
if(y%5==0)
while(y%5==0)
{k++;
y=y/5;}
x++;}
g<<x-1;}