2013-09-12から1日間の記事一覧

Project Euler 2

PE

Problem 2 using System; namespace PE { public class PE002 { public static void Calc() { const int n = 4000000; int a = 1; int b = 2; int sum = 2; while (b <= n) { int tmp = a + b; a = b; b = tmp; if (tmp % 2 == 0) sum += tmp; } Console.Wri…