From 497a7f856bae6ac4b5d5013aab6ad1fca8b003a1 Mon Sep 17 00:00:00 2001 From: sayebabu Date: Wed, 25 Oct 2023 17:27:30 +0200 Subject: [PATCH] fini --- DEV IHM/TP2/Synopsis.txt | 6 +++ DEV3.2/Piles/Arithmetique/build/arithm.class | Bin 0 -> 1812 bytes DEV3.2/Piles/Arithmetique/src/arithm.java | 44 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 DEV IHM/TP2/Synopsis.txt create mode 100644 DEV3.2/Piles/Arithmetique/build/arithm.class create mode 100644 DEV3.2/Piles/Arithmetique/src/arithm.java 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 0000000000000000000000000000000000000000..922fa56e141d55cd9603a45e1e7e617ae63f05ec GIT binary patch literal 1812 zcmaJ?-%}e^6#h;UayQGCgdd@#HWVt*BuG)C_q0IQE5A=sK9mhwY_dDOYx%u_k zlcxYK>x+hq$U|#_Dg+wk(H0n74D^8X9iqu#P4;S50P=Bv9WB_7xZO|yA|2cP0rDqxqG;% z>>}aByr-|M&+4@%UZBi;j(`%>d8bidF{VwKwcX$MykySuUvV7I_3CO8sgsc3NuYm|+cpuX|W@zXZ z!cZA-|0jss4-u>6ijh?0X`wA#h$f@Sw(rPFMUv6+qDYA@bq9Uyv>kM^>)3(HF7beh zDN$5Hg;+}2L)Z7b2T*0pvE|v8*v_%Zxwl(>CZ%+#d+7THg>WIZiwhiU&3Ggt;{lF4 znsINNj1wFunsGE*h$UlkmtWZAC(M>+n_=5z`*!p(P7{8{**y$R1cS-Z)9Fth;oM`4 zhOo4Y&x0=yA*%u8!m&szfXp3>Tniwz(UkC+d>N(PXJ7q@^ZwdLc=L%=Y7ZsZy->4z z%jn~A6bgR_xn~p5@EbbtJL32Q3H*sp{Dp1`qlXemQX0K9fIb>Sii$WzGkh;zN1B$< zPgR_uO}@E34AW=)7xM)&^fljgQo&1zKj*to2wW3VR`z_L@h`Fh-Tz^npA?VBwf<~2 q`!_~H|3G=pXD{>u&+WM0B>e#@>=iy}vuyMDh$EFpi})CKkoq6*oS#Ji literal 0 HcmV?d00001 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()); + } +}