30 lines
785 B
Java
30 lines
785 B
Java
import java.util.ArrayDeque;
|
|
import java.util.Comparator;
|
|
|
|
public class Main {
|
|
public static void main(String[] args) {
|
|
Fusion<Double> f = new Fusion<Double>(new Comparator<Double>() {
|
|
|
|
@Override
|
|
public int compare(Double o1, Double o2) {
|
|
if (o1 > o2) return 1;
|
|
else if (o1 == o2) return 0;
|
|
else return -1;
|
|
}
|
|
});
|
|
|
|
ArrayDeque<Double> list = new ArrayDeque<>();
|
|
|
|
for (String arg : args) {
|
|
try {
|
|
double d = Double.parseDouble(arg);
|
|
list.addFirst(d);
|
|
} catch (Exception e) {
|
|
System.out.println("Invalid arg : " + arg);
|
|
}
|
|
}
|
|
|
|
System.out.println(list.toString());
|
|
}
|
|
}
|