Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectEuler.MetodosComuns
{
public static class Comuns
{
if (n == 1 || n == 0)
return retorno;
else
{
while (n != 1)
{
retorno = retorno * n;
n--;
}
}
return retorno;
return retorno;
}
return lstDivisors;
}
}
else
{
lstString.Add(strNumber[i].ToString());
}
}
return true;
if (i > numerosPrimos.Max())
{
for (long j = numerosPrimos.Max(); j < i; j++)
{
isPrime = true;
for (int k = 0; k < numerosPrimos.Count; k++)
{
if (j % numerosPrimos[k] == 0)
{
isPrime = false;
break;
}
}
if (isPrime)
{
numerosPrimos.Add(j);
}
}
}
return numerosPrimos;
}
if (i > numerosPrimos.Max())
{
for (long j = numerosPrimos.Max(); j < i; j++)
{
isPrime = true;
for (int k = 0; k < numerosPrimos.Count; k++)
{
if (j % numerosPrimos[k] == 0)
{
isPrime = false;
break;
}
}
if (isPrime)
{
numerosPrimos.Add(j);
}
}
}
return numerosPrimos;
}
return isPrime;
}
}
}