Trouver la plus grande valeur entre deux ‘BigInteger’

Author:

Calculer,la,puissance,d'un,nombre,de,type,'BigInteger'
{filelink=20041}

using System;
using System.Numerics;

public class ExPlusGrand
{
    public static void Main()
   {
      BigInteger[] nombres = { BigInteger.MinusOne, BigInteger.Pow(Int32.MaxValue, 2) };
      BigInteger largest = nombres[nombres.GetLowerBound(0)];

      for (int ctr = nombres.GetLowerBound(0) + 1; ctr <= nombres.GetUpperBound(0); ctr++)
         largest = BigInteger.Max(largest, nombres[ctr]);

      Console.WriteLine(largest);
   }
}

Leave a Reply

Your email address will not be published. Required fields are marked *