DEV/DEV2.1/TP0:Introduction/Somme.java

10 lines
238 B
Java
Raw Normal View History

2023-02-13 11:29:17 +01:00
public class Somme{
public static void main(String[] args) {
int resultat=0;
for(int i=0;i<args.length;i++){
int n = Integer.parseInt(args[i]);
resultat=resultat+n;
} System.out.println("Le resultat est:"+" "+resultat);
}
}