From 8af4c7fb7012f31ad43152d28515e1343f8d8bef Mon Sep 17 00:00:00 2001 From: Meutel Date: Thu, 30 May 2019 16:33:36 +0200 Subject: [PATCH] Exo maximum --- Exercice1.java | 36 ++++++++++++++++++++++++------------ Maximum.java | 32 ++++++++++++++++++++++++++++++++ Variables.java | 26 ++++++++++++++++---------- 3 files changed, 72 insertions(+), 22 deletions(-) create mode 100644 Maximum.java diff --git a/Exercice1.java b/Exercice1.java index bcf8bf5..4eb8591 100644 --- a/Exercice1.java +++ b/Exercice1.java @@ -3,23 +3,35 @@ import static utils.Utils.*; public class Exercice1 { // FIXME A CHANGER public static final void main(String[] args) { - int a = 3; - int compteur = 0; - String texte="Trop grand"; + int a = 13; + if (a<10) { - - while(compteur valeurMax){ + valeurMax = element; + } + } + + return valeurMax; + + } + + + + + +} diff --git a/Variables.java b/Variables.java index 09ddecc..10e5859 100644 --- a/Variables.java +++ b/Variables.java @@ -3,21 +3,27 @@ import static utils.Utils.*; public class Variables { public static final void main(String[] args) { - int a = 0; - char b; - b = '0'; + int i = 0; + int j= 1; - boolean c = true; - boolean d = false; + int k = ajouter(2, j); - afficher(a, b, c, d); - afficher("c ou d"); - afficher(c || d); + ajouterEtAfficher(2, 4); - boolean expr1 = c && d; - afficher(expr1); + afficher(k + 1); } + public static int ajouter(int a, int b) { + int c = a + b; + return c; + } + + + public static void ajouterEtAfficher(int a, int b) { + int c = a + b; + afficher("resultat:", c); + } + }