mmm,
I don't understand why it won't work like that.
I saw the modulo solution but i don't understand either.
Can someone explain it to me ?
Thx ;)
package fr.codegym.task.task04.task0416;
/*
Traverser les yeux fermés
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
//écris ton code ici
Scanner sc = new Scanner(System.in);
double t1 = sc.nextDouble();
if (t1 >= 0 && t1 < 3);
System.out.println("vert");
if (t1 >= 3 && t1 < 4) {
System.out.println("jaune");
}
if (t1 >= 4 && t1 < 5) {
System.out.println("rouge");
}
}
}