static void Main(string[] args)
 {
     List<NumberGroup> grp = new List<NumberGroup>();
     for (int a = 1; a < 500; a++)
     {
         for (int b = a + 1; b < 1000 - a - b; b++)
         {
             int c = 1000 - a - b;
             NumberGroup ng = new NumberGroup(a,b,c);
             if (ng.CheckPythagoreanTriplet())
             {
                 Console.WriteLine(ng.Product());
                 Console.Read();
                 return;
             }
         }
     }
 }
Exemple #2
0
        static void Main(string[] args)
        {
            List <NumberGroup> grp = new List <NumberGroup>();

            for (int a = 1; a < 500; a++)
            {
                for (int b = a + 1; b < 1000 - a - b; b++)
                {
                    int         c  = 1000 - a - b;
                    NumberGroup ng = new NumberGroup(a, b, c);
                    if (ng.CheckPythagoreanTriplet())
                    {
                        Console.WriteLine(ng.Product());
                        Console.Read();
                        return;
                    }
                }
            }
        }