BigInteger: Trouver le plus grand commun diviseur

Author:

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

using System;
using System.Numerics;

public class ExPlusGrandCommunDiv
{
   public static void Main()
   {

        BigInteger nbr1 = BigInteger.Pow(9999999999, 2);
        BigInteger nbr2 = BigInteger.Multiply(9999999999, 99999999);
        try
        {
            Console.WriteLine("plus grand commun diviseur de {0} et {1} est:{2} ",
                             nbr1, nbr2, BigInteger.GreatestCommonDivisor(nbr1, nbr2));
        }
        catch (ArgumentOutOfRangeException ex)
        {
           Console.WriteLine(ex);
        }
   }
}

Leave a Reply

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