From 04e6feb86f2261853b3ec955d8f07f48cb1451e8 Mon Sep 17 00:00:00 2001 From: Vieira Enzo Date: Mon, 7 Feb 2022 07:10:26 +0100 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20'APL1?= =?UTF-8?q?.2/Dev1.2'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APL1.2/Dev1.2/Arguments.java | 7 +++++++ APL1.2/Dev1.2/Demarrage.java | 20 ++++++++++++++++++++ APL1.2/Dev1.2/Somme.java | 9 +++++++++ APL1.2/Dev1.2/Tri.java | 14 ++++++++++++++ APL1.2/Dev1.2/grille.java | 22 ++++++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 APL1.2/Dev1.2/Arguments.java create mode 100644 APL1.2/Dev1.2/Demarrage.java create mode 100644 APL1.2/Dev1.2/Somme.java create mode 100644 APL1.2/Dev1.2/Tri.java create mode 100644 APL1.2/Dev1.2/grille.java diff --git a/APL1.2/Dev1.2/Arguments.java b/APL1.2/Dev1.2/Arguments.java new file mode 100644 index 0000000..fb78268 --- /dev/null +++ b/APL1.2/Dev1.2/Arguments.java @@ -0,0 +1,7 @@ +public class Arguments { + public static void main(String[] args) { + for(int i = 0; i < args.length; i++) { + System.out.println("Salut " + args[i]); + } +} +} diff --git a/APL1.2/Dev1.2/Demarrage.java b/APL1.2/Dev1.2/Demarrage.java new file mode 100644 index 0000000..402d20a --- /dev/null +++ b/APL1.2/Dev1.2/Demarrage.java @@ -0,0 +1,20 @@ +public class Demarrage { + public static void main(String[] args) { + byte premier = 123; + short deuxieme = 124; + int troisieme = -125; + long quatre = 126L; + boolean cinq = true; + char six = 'o'; + float sept = 13.5f; + double huit = 50.0d; + System.out.println(premier); + System.out.println(deuxieme); + System.out.println(troisieme); + System.out.println(quatre); + System.out.println(cinq); + System.out.println(six); + System.out.println(sept); + System.out.println(huit); + } +} \ No newline at end of file diff --git a/APL1.2/Dev1.2/Somme.java b/APL1.2/Dev1.2/Somme.java new file mode 100644 index 0000000..8076ace --- /dev/null +++ b/APL1.2/Dev1.2/Somme.java @@ -0,0 +1,9 @@ +public class Somme { + public static void main(String[] args) { + int total = 0; + for(int i = 0; i < args.length; i++) { + total = total + Integer.parseInt(args[i]);; +} + System.out.print("La somme totale est : " + total); +} +} diff --git a/APL1.2/Dev1.2/Tri.java b/APL1.2/Dev1.2/Tri.java new file mode 100644 index 0000000..8ff3eb4 --- /dev/null +++ b/APL1.2/Dev1.2/Tri.java @@ -0,0 +1,14 @@ +import java.util.Arrays; +public class Tri { + public static void main(String[] args) { + int[] total = null; + total = new int[args.length]; + for(int i = 0; i < args.length; i++) { + total[i] = Integer.parseInt(args[i]); +} + Arrays.sort(total); + for(int i = 0; i < args.length; i++) { + System.out.println(total[i]); +} + } +} diff --git a/APL1.2/Dev1.2/grille.java b/APL1.2/Dev1.2/grille.java new file mode 100644 index 0000000..5d60350 --- /dev/null +++ b/APL1.2/Dev1.2/grille.java @@ -0,0 +1,22 @@ + +public class grille { + public static void main(String[] args) { + for(int j = 0; j < Integer.parseInt(args[0]); j++) { + System.out.print("+"); + for(int i = 0; i < Integer.parseInt(args[0]); i++) { + System.out.print("-+"); +} + + System.out.print("\n|"); + for(int i = 0; i < Integer.parseInt(args[0]); i++) { + System.out.print(" |"); + } + System.out.print("\n"); + } + System.out.print("+"); + for(int i = 0; i < Integer.parseInt(args[0]); i++) { + System.out.print("-+"); +} +} +} +