From 68fa123bfe5d37e18ac1fa3d5c09cfcfdb0842ca Mon Sep 17 00:00:00 2001 From: Meutel Date: Mon, 17 Jun 2019 17:38:16 +0200 Subject: [PATCH] Exercice FizzBuzz --- FizzBuzz.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/FizzBuzz.java b/FizzBuzz.java index 86a4707..3ed1081 100644 --- a/FizzBuzz.java +++ b/FizzBuzz.java @@ -4,6 +4,22 @@ public class FizzBuzz { public static final void main(String[] args) { - } + +for (int a=1; a<=199; a++){ + if (a%3==0){ + if (a%5==0) { + afficher("FizzBuzz"); + } else { + afficher("Fizz"); + } + } else{ + if (a%5==0){ + afficher("Buzz"); + } else{ + afficher(a); + } + } +} + } }