Search This Blog

Saturday, December 18, 2010

Euler Problem 9

Did this a while ago but didn’t post… so here it is…

 

static void Main(string[] args)
       {

           for (int a = 1; a < 100000; a++)
           {
               for (int b = a; b < 100000; b++)
               {

                   double c = Math.Sqrt((a*a)+(b*b));
                   if (a + b + c == 1000)
                   {
                       Console.WriteLine(a + "," + b + "," + c);
                       Console.WriteLine(a * b * c);
                   }

               }


           }

       }

No comments: