Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
olution to problem #2 from projecteuler.net
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int limit = 4000000; int N_minus_2 = 0; int N_minus_1 = 1; int result = 0; int temp = 0; while (temp < limit) { temp = N_minus_1 + N_minus_2; N_minus_2 = N_minus_1; N_minus_1 = temp; if((temp & 1) == 0) { result = temp + result; } } Console.WriteLine("result is " + result); } } }
run
|
edit
|
history
|
help
0
jkb
Events
JavaScript
compiled prog
Kumaran-RegText-CityStatePostalCode Parsing
Event test
Calculadora
Fórum ➡ Rotating a Square Matrix One Cell Counter Clockwise
puzzle piezas
ICollection<T>.Add(T) - Performance Test