/** * Cette classe calcule le pgcd de deux entiers en utilisant l'algorithme d'Euclide */ class Euclide { static int pgcd(int m, int n) { int r; while (n != 0) { r= m % n; m= n; n= r; } return m; } public static void main(String[] args) { int a,b; a = Integer.parseInt(args[0]); b = Integer.parseInt(args[1]); System.out.println("Le pgcd de " + a + " et " + b + " est " + pgcd(a,b)); } }