2014-09-01から1ヶ月間の記事一覧

Project Euler 43

C# PE

Problem 43 using System; using System.Collections.Generic; using System.Linq; class PE043 { static long Calc(int p, int[] digits, bool[] used) { int[] ds = { 0, 0, 2, 3, 5, 7, 11, 13, 17 }; long ret = 0; int x = 100 * digits[p-3] + 10 * di…

Project Euler 42

Problem 42 using System; using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using System.Linq; class PE042 { static bool IsTriangleWord(string word) { int sum = word.Select(c => c - 'A' + 1).Sum(); int…