BUT2/DEV/DEV3.2/TP02_Recursivite/Q1Main.java

15 lines
458 B
Java
Raw Normal View History

2023-10-12 16:39:49 +02:00
public class Q1Main{
public static void main(String[] args) {
try{
long n = Long.parseLong(args[0]);
Q1Factoriel calcul = new Q1Factoriel();
System.out.println(calcul.factoriel(n));
}
catch(NumberFormatException e){
System.out.println("erreur argument");
}
catch(ArrayIndexOutOfBoundsException e){
System.out.println("erreur argument");
}
}
}