2013-10-07から1日間の記事一覧

Project Euler 6

Problem 6 using System; namespace PE { public class PE006 { public static void Calc() { int sumsq = 0; for (int i = 1; i <= 100; i++) { sumsq += i * i; } int sqsum = (int)Math.Pow(100 * 101 / 2, 2); Console.WriteLine(sqsum - sumsq); } } }