Cod sursa(job #624461)
Utilizator | Data | 22 octombrie 2011 13:47:30 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
int main()
{
long long n;
int i=0,ct=0,p;
f>>p;
if (p==0)
cout<<1;
else
{
while (ct<p)
{
i++;
if (i%5==0 || i%10==0)
ct++;
if (i%25==0 || i%100==0)
ct++;
if (i%125==0 || i%10000==0)
ct++;
}
cout<<i;
}
}