Rate this:
See more:
How should I start coding this?
Posted 23-Nov-12 12:45pm
Edited 3-Dec-12 8:36am
v2
Sergey Alexandrovich Kryukov at 23-Nov-12 18:18pm

Not a valid question. What's "how"?
--SA

Rate this:

## Solution 2

I would start with the first row (and the mathematical definition [^]).
You may use the recurrence relation (shown in the linked page) to compute their values (in a simple, rough approach, you might use a `10` x `10` array to store the numbers as computation proceedes).
v2
Rate this:

## Solution 4

This is a little simpler and more flexible implementation:

```public static void EeulerBernoulli(int limit)
{
var E = new List<int[]>();

for (int n = 0; n < limit; n++)
{
for (int k = 0; k <= n; k++)
{
E[n][k] = (k != 0) ? (E[n][k - 1] + E[n - 1][n - k]) :
(n == 0 ? 1 : 0);
}
}
}```
Rate this:

## Solution 1

Just use an query like this

select TOP 10 from tablename
Rate this:

## Solution 3

```static void CreatEeulerBernoulli()
{
euler_Bernoulli[0, 0] = 1;
for (int i = 1; i < 10; i++)
{
if (i % 2 == 0)
evenArray(i);
else
oddArray(i);
}
WriteToScreen(euler_Bernoulli);
}

static void oddArray(int currentIndex)
{
for (int i = 0; i < currentIndex; i++)
{
int currentSum = 0;
for (int j = 0; j < currentIndex - i; j++)
currentSum = euler_Bernoulli[currentIndex - 1, j] + currentSum;

if (currentIndex >= i)
euler_Bernoulli[currentIndex, currentIndex - i] = currentSum;
}
}

static void evenArray(int currentIndex)
{
for (int i = 0; i < currentIndex; i++)
{
int currentSum = 0;
for (int j = i; j < 10; j++)
currentSum = euler_Bernoulli[currentIndex - 1, j] + currentSum;

if (currentIndex >= i)
euler_Bernoulli[currentIndex,  i] = currentSum;
}
}

static void WriteToScreen(int[,] result)
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("array index of " + i.ToString());
for(int k=0; k<10; k++)
Console.Write((result[i,k].ToString())+",");
}
}
```
v2