ANDROID WE
This commit is contained in:
BIN
DEV3.2/CM1/01_Division/Main.class
Normal file
BIN
DEV3.2/CM1/01_Division/Main.class
Normal file
Binary file not shown.
31
DEV3.2/CM1/01_Division/Main.java
Normal file
31
DEV3.2/CM1/01_Division/Main.java
Normal file
@@ -0,0 +1,31 @@
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
ArrayDeque<String> textes = new ArrayDeque<>();
|
||||
ArrayDeque<Integer> entiers = new ArrayDeque<>();
|
||||
|
||||
for (String chaine : args) {
|
||||
try {
|
||||
Integer entier = new Integer(Integer.parseInt(chaine));
|
||||
|
||||
entiers.addLast(entier.intValue());
|
||||
} catch (NumberFormatException e) {
|
||||
textes.addLast(chaine);
|
||||
}
|
||||
}
|
||||
|
||||
for (Integer entier : entiers) {
|
||||
System.out.print(entier + " ");
|
||||
}
|
||||
|
||||
System.out.println("");
|
||||
|
||||
for (String texte : textes) {
|
||||
System.out.print(texte + " ");
|
||||
}
|
||||
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user