diff --git a/DEV IHM/TP2/Synopsis.txt b/DEV IHM/TP2/Synopsis.txt new file mode 100644 index 0000000..bdb8b61 --- /dev/null +++ b/DEV IHM/TP2/Synopsis.txt @@ -0,0 +1,6 @@ +Synopsis + +le jardinier papé14 separe la partielle +il observe la premiere moitier +il separe la deuxieme parcelle +il change d'avis et reunis les dexu sous parcelle \ No newline at end of file diff --git a/DEV3.2/Piles/Arithmetique/build/arithm.class b/DEV3.2/Piles/Arithmetique/build/arithm.class new file mode 100644 index 0000000..922fa56 Binary files /dev/null and b/DEV3.2/Piles/Arithmetique/build/arithm.class differ diff --git a/DEV3.2/Piles/Arithmetique/src/arithm.java b/DEV3.2/Piles/Arithmetique/src/arithm.java new file mode 100644 index 0000000..8f77a63 --- /dev/null +++ b/DEV3.2/Piles/Arithmetique/src/arithm.java @@ -0,0 +1,44 @@ +import java.util.Deque; +import java.util.LinkedList; + +public class arithm { + public static void main(String[] args) { + Deque pile = new LinkedList<>(); + Object x; + int a,b; + for (int i = 0; i < args.length; i++) + { + x = args[i]; + if (x == "+" || x == "-" || x == "/" || x == "*" ) + { + switch (x) { + case "+": + a = (Integer) pile.pop(); + b = (Integer) pile.pop(); + pile.add(a+b); + break; + case "-": + a = (Integer) pile.pop(); + b = (Integer) pile.pop(); + pile.add(a-b); + break; + case "/": + a = (Integer) pile.pop(); + b = (Integer) pile.pop(); + pile.add(a/b); + break; + case "*": + a = (Integer) pile.pop(); + b = (Integer) pile.pop(); + pile.add(a*b); + break; + } + } + else + { + pile.add(x); + } + } + System.out.println("="+pile.pop()); + } +}