using System; using System.Collections.Generic; using System.Text; namespace euler6 { //Find the difference between the sum of the squares //of the first one hundred natural numbers and the square of the sum. class Program { static void Main(string[] args) { int n =100; long squaredSum = (n * (n + 1)) / 2; squaredSum *= squaredSum; long sumSquares = 0; for(int i=1; i<=n;++i) sumSquares += (i*i); Console.WriteLine(squaredSum - sumSquares); Console.ReadLine(); } } }