From d934da10c1c8f3a409a9709569f748ade70831c1 Mon Sep 17 00:00:00 2001 From: Simon Saye Babu Date: Thu, 27 Apr 2023 11:24:21 +0200 Subject: [PATCH] TP iostream --- DEV2.1/TP7/Fond.class | Bin 0 -> 953 bytes DEV2.1/TP7/Fond.java | 35 ++++++++++ DEV2.1/TP7/MainFond.java | 47 +++++++++++++ DEV2.1/TP7/image.java | 44 ++++++++++++ DEV2.1/hasard/exo1/Primalite.class | Bin 0 -> 1113 bytes DEV2.1/hasard/exo1/Primalite.java | 37 +++++++++++ DEV2.1/hasard/exo2/Entiexte.class | Bin 0 -> 1354 bytes DEV2.1/hasard/exo2/Entiexte.java | 85 ++++++++++++++++++++++++ DEV2.1/hasard/exo2/test.class | Bin 0 -> 702 bytes DEV2.1/hasard/exo2/test.java | 15 +++++ DEV2.1/hasard/exo3/ObjetAleatoire.class | Bin 0 -> 153 bytes DEV2.1/hasard/exo3/ObjetAleatoire.java | 5 ++ DEV2.1/hasard/exo3/Piece.class | Bin 0 -> 763 bytes DEV2.1/hasard/exo3/Piece.java | 25 +++++++ DEV2.1/hasard/reponses.tar | Bin 0 -> 20480 bytes 15 files changed, 293 insertions(+) create mode 100644 DEV2.1/TP7/Fond.class create mode 100644 DEV2.1/TP7/Fond.java create mode 100644 DEV2.1/TP7/MainFond.java create mode 100644 DEV2.1/TP7/image.java create mode 100644 DEV2.1/hasard/exo1/Primalite.class create mode 100644 DEV2.1/hasard/exo1/Primalite.java create mode 100644 DEV2.1/hasard/exo2/Entiexte.class create mode 100644 DEV2.1/hasard/exo2/Entiexte.java create mode 100644 DEV2.1/hasard/exo2/test.class create mode 100644 DEV2.1/hasard/exo2/test.java create mode 100644 DEV2.1/hasard/exo3/ObjetAleatoire.class create mode 100644 DEV2.1/hasard/exo3/ObjetAleatoire.java create mode 100644 DEV2.1/hasard/exo3/Piece.class create mode 100644 DEV2.1/hasard/exo3/Piece.java create mode 100644 DEV2.1/hasard/reponses.tar diff --git a/DEV2.1/TP7/Fond.class b/DEV2.1/TP7/Fond.class new file mode 100644 index 0000000000000000000000000000000000000000..18b14dee3909f64955100f5aa50496eb722623aa GIT binary patch literal 953 zcmZuw*>2iE6g`6hgE0`GTWEkJ-N0-~o2Cm@q(Vrgil7L(sE-azky~R&#w7iKeoNom z2O_mnKcF8~^^Q#fmGW|Z&)k`F&t3fI@6X==cF<6eL{`S_2-Xw?kW-LAK7v97>jG~m z*ud9WRMfF0 zV_U^TJd&}a;xTqrJi${H&xH3JyF?)}F{JZs;W>^_<*Jq_% zV_g(_tyuCEEQ@AHT+*~`)27;j&Cc64F)YiaK!XN1;ck;gH*)N$V9YGZ^d9>?=(YF7 zBzo<37aO!;Ne~;YW`MplQnDFBUm+n#-+k>I>=yzb($YDC9j!b==)H%-gb%gKC6)U$5kSLJU5Djhy`a%ZVX)~RYxO2h6 zzo08aVpzC>MImbV0sIbsg(2d7gMvciEZ)2C-gD2r=e{?`KffFSn8bq++K~*Q5B)(5 zz|fHjL6IH>g8^KZ`;c62gfNVo0i*-SNHZ&!5goU5j1sgt%eLG+!Jp2o5R}K2q98<` zTDDlMm)C^z+*~WMM=6_@P3TImKHW68%v{N|H*y8nvFwdmnb=xz&GpyM%&LdiF{UF& z2o)-IXI(t8Bt_e@W0lR4<%%&$5k?21I>y7ejR_rh!Ypcv(0!TyQQayPg%id!?lOrX zYOb;Dh_WRdBPG4}!nlta9kXG~VV*GTLF|fcRL@{3qh!@wVH8EpC|X-qP1GG@hCoIb zdCbeSC?R;>9-;lBiKVqovF;K&n+PZPRu>2z7w84s6&u1K1gfS}6MQ7Z(oIIjX@3e z^i^VJ?DQ1=+Ymvo%Jxe9ESgH>SD|_cq!8i9DnB21T!`}8$)`TviFY-70NP`N8{k#* zoO~mQp^I&X(h9$1onwdoxkUD82m9H?#36k1NH2Av1T&x$6wo z9dCJPA@FP7^0-25qUP0tNhTF$t;;+rjU`v1W3J}87glaBy8ds@Vx5s};oEX4hzE^r zFomvy^=*!V;k$QT{|+$*_QKe!B()GY)!*lxX4u@oafN8mnDqh$tzgY6B%1Y=JLi4J zTT)0B=FWOS&HXcQ$E|A$$%V#>UvqsEIT>P3*@36DRSj zi7}iqF^*n^^w&yB;e?4YCJjuPIE^!$yaoM5{>8;xZk0SE*DE1eO4PZF#u40Qm&<4m z8q+n;@$a?7%ToWnq=+{iY8Q^a=L#rBThOT7bo?{E@7$9`TGBdJcfIA{CWR|pugIce zRmmYU*)$W{cUjFllBhKse@Obwj5UKkUbPNhBn~1n(TmZ~;0M|+K9!;I4Y1$dfUHw(V!oHlWl0CoIm=W}wr?X%jGcGk-)|2-Up}`5^o{CvfA@nyLUSL|80q7=kZk@hN@_;}BI8%Iq*adA=&+7Dy zXnhSQlJ&tvGvG{52=W~31L$W#M4^$y2KDUaSAVjk&=F2mY{R?f*FB(sKo@p3PaOb`Es zbkF@RwB_z^B2|4ju^J(rw>|5hSsWk)V3Ctev5u0@AfIduVL0sG2JHiMr4GL%Q5BNh z7UeZN%hndP@=oL8cK;`c>g!*I))3WNA$@5w{|F^X$djTJ$@v&vt&p%Lgtoq_Z9U!k zU)v>noVNoQCE1gdY>YCNF@Px)P+{~eW^o>uX|G@&*BHBjg>Z;8V(*bvnfFMjBUDi) J=?f(|^a<~@{1gBH literal 0 HcmV?d00001 diff --git a/DEV2.1/hasard/exo2/Entiexte.java b/DEV2.1/hasard/exo2/Entiexte.java new file mode 100644 index 0000000..9d98301 --- /dev/null +++ b/DEV2.1/hasard/exo2/Entiexte.java @@ -0,0 +1,85 @@ +import java.lang.Math; + +public class Entiexte +{ + private String repr; + + public Entiexte(int i) + { + this.repr = Integer.toBinaryString(i); + this.repr = this.reverse(this.repr); + } + + public Entiexte(String i) + { + int temp = Integer.parseInt(i); + this.repr = Integer.toBinaryString(temp); + this.repr = this.reverse(this.repr); + } + + public String toString() + { + return this.repr; + } + + private String reverse(String txt) + { + char temp; + char[] txt2 = txt.toCharArray(); + for (int i = 0;ie.repr.length()) + { + return true; + } + else + { + if (this.repr.length()=0;i--) + { + if (this.repr.charAt(i)!=e.repr.charAt(i)) + { + if (this.repr.charAt(i)=='1') + { + return true; + } + else + { + return false; + } + } + } + } + } + return false; + } +} \ No newline at end of file diff --git a/DEV2.1/hasard/exo2/test.class b/DEV2.1/hasard/exo2/test.class new file mode 100644 index 0000000000000000000000000000000000000000..5026d280f0cb687f05875d854270598d0db1b225 GIT binary patch literal 702 zcmZuv+iuf96r6SJ*l`_tp#=)G&~mfWOGqgo2=IamL<%iZP$kL(IPI!(mDp9XLGUm9 z1U$GBNPGYvg_x5F0s=qm&d$!BojKm`KfZheu!*}qCUMTiyod8XELaQ zk}8}DUpJ59cX727r-#*+=_To5T@L!KY|z`+PZANAjP9Ft(FK^ow1T&lnnb@h+_P#m zAtM)+04rDxu!eOP)c`jU1*l;|&@BaZPsE!6W8N0(4oyg1g{iTFo%WI5Cp8!T-_{?} z)`z~)T?Wkta$uxSvg!+FFifK3Zke*hK|C?{hd7>BGe$JcRVLLFOSQ@C*T3DB}&o@$pb=;p|Ug$%dQ& literal 0 HcmV?d00001 diff --git a/DEV2.1/hasard/exo2/test.java b/DEV2.1/hasard/exo2/test.java new file mode 100644 index 0000000..3d85d06 --- /dev/null +++ b/DEV2.1/hasard/exo2/test.java @@ -0,0 +1,15 @@ +public class test +{ + public static void main(String[] args) { + + Entiexte test = new Entiexte("11"); + System.out.println(test.toString()); + System.out.println(test.toInt()); + Entiexte test2 = new Entiexte("9"); + Entiexte test3 = new Entiexte("11"); + Entiexte test4 = new Entiexte("14"); + System.out.println(test.plusGrand(test2)); + System.out.println(test.plusGrand(test3)); + System.out.println(test.plusGrand(test4)); + } +} \ No newline at end of file diff --git a/DEV2.1/hasard/exo3/ObjetAleatoire.class b/DEV2.1/hasard/exo3/ObjetAleatoire.class new file mode 100644 index 0000000000000000000000000000000000000000..13c397133affb40d2002e77da1319b17ae054ea0 GIT binary patch literal 153 zcmX^0Z`VEs1_l!bZgvJvb_Om+2DY5UyyVm(Mh0dL%`ip=mYmF@R4~Vrk%22XzqBYh z)h#mzC?xEkl$BcIn3I}Vk`Gj)mz7wS$jHElD$2+p020>+8k(*Tl1eUNV`N}tU;;tU)BQv4uZ literal 0 HcmV?d00001 diff --git a/DEV2.1/hasard/exo3/ObjetAleatoire.java b/DEV2.1/hasard/exo3/ObjetAleatoire.java new file mode 100644 index 0000000..2c49e00 --- /dev/null +++ b/DEV2.1/hasard/exo3/ObjetAleatoire.java @@ -0,0 +1,5 @@ +public interface ObjetAleatoire +{ + void lancer(); + int lire(); +} \ No newline at end of file diff --git a/DEV2.1/hasard/exo3/Piece.class b/DEV2.1/hasard/exo3/Piece.class new file mode 100644 index 0000000000000000000000000000000000000000..f41b915f547aa8f849cf85abfe38d227c77042aa GIT binary patch literal 763 zcmZ8f+iuf95IvjNabh;5O-RbElsireHJ5S?LPC|0QU$1JRjK01NtS9W$F5ul!9Vdr z)h38ad;lMXIO_xueVLh^ojG&P?Ed`q{Re;*JaaLFMF*E%T)|ZrIb18Di0dZ0VWOK3 zZn^Y}#&{)GHB8iWv4qpwih5J_i0U)uI0`i2CuM#jCyegMerY6rSry zr!ScD8e0O^YTQ=>r#m`QZ-#@eN;ZRT$V?#&qMk}v5$c3zmb2R$1UeF^d+#SxShVAB zq=}ApS_aPDh=)l}z0wB4UDv9omJJ<=GpGs7o}}i$m$-|2=Kj9KEaoI0U`3*Ws(_sV zNSsAY;vpVMoWpqsk0qYq=^wO=!rShy>ZJlRCP-g~DoEpu_GIFO=I8xX4Fu+T!z58r zx~T{1wGKnQpQ&4;I&aO0a3b|7ZAXN&ytYxDkB28G@lekC~eNjq_>#oerW4F`LG!Q)#ezYd5qllH{{2#j$nUfT40{m z{0!4*p}-6mG;MAmpEZ}8%|qDs2!$g!C)*?>$}HnHr)>-LW~R+9=gZ$I1{xFEFwA}WJ zCArsYcFEE-s+DdVi>1Z-Mt#5b}tq~!+B|67*1QYxFak-Sm5S=#cE@C4_x z*^TC3&t&t?{HF@|3NZiKTvjJ7wdIm@VfYiD|JC|p*<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