Play SAH
Search
Log in
Register
/
Forams
SUPERJER FORAMS
≡
Forum Index
Play SAH
Search
Register
Log in
SuperJer.com
Euler Answers
Euler Answers
if( while ) switch{ coding } ++
— Page [1]
sprinkles
2009 Sep 6 • 2547
10 ₧
http://projecteuler.net/problem=2
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int Lux = fibonacci_numbers();
Console.WriteLine(Lux);
Console.ReadLine();
}
private static int fibonacci_numbers()
{
// x=n-1
// y=n-2
int x = 3;
int[] array = new int[34];
int fib = 0;
array[0] = 0; array[1] = 1; array[2] = 1;
while (x < 34)
{
array[x] = array[x-1] + array[x-2];
x++;
}
foreach (int element in array)
{
if (element % 2 == 0)
{
fib += element;
}
}
return fib;
}
}
}
// 2
// 2
≡
2012 Mar 23 at 01:36 UTC
SuperJer
Websiteman
2005 Mar 21 • 6666
Good job.
You're not really supposed to share your answer outside of the PE forums, though. B/c then people can see the answer before they figure it out themselves.
≡
2012 Mar 29 at 02:51 UTC
Down Rodeo
Cap'n Moth of the Firehouse
2007 Oct 19 • 5486
57,583 ₧
sprinkles said:
http://projecteuler.net/problem=2
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
...
}
}
}
// 2
// 2
That's worse than Java!
I give a little into the moment like I'm standing at the edge (I know)
That no-one's gonna turn me 'round
Just one more step, I could let go
≡
2012 Mar 29 at 04:06 UTC
SuperJer
Websiteman
2005 Mar 21 • 6666
It's just not real code if it doesn't have at least 3 indentation-levels of boilerplate.
≡
2012 Mar 31 at 01:15 UTC
sprinkles
2009 Sep 6 • 2547
10 ₧
DR said you might have some cool projects/problems like this, superjer. If you do, would you share/make a contest for them?
≡
2012 Mar 31 at 15:55 UTC
Down Rodeo
Cap'n Moth of the Firehouse
2007 Oct 19 • 5486
57,583 ₧
I was probably referring to his one-time challenges in this subforum thingy. Never did get them.
I give a little into the moment like I'm standing at the edge (I know)
That no-one's gonna turn me 'round
Just one more step, I could let go
≡
2012 Apr 1 at 00:51 UTC
SuperJer
Websiteman
2005 Mar 21 • 6666
These are them:
http://www.superjer.com/forum/c_puzzle.php
http://www.superjer.com/forum/c_puzzle_2_1_2_3_4_5_6_7_8.php
I haven't come up with any more yet.
≡
2012 Apr 3 at 01:02 UTC
Page [1]