at firs read i though about a loop, but i couldn't figure out how to do it, so i do it with paper so i think as it follow
double a = (t/5.00); divide insert time for 5
double b = 0;
b= t-(a*5); insert ime - (correct numer of ciclo)
/* if (b>=0 && b,3)
System.out.println("yellow");
else if(b>=4 && b<5)
System.out.println("red");
else
System.out.println("green");*
but it was't working, a friend give me the attached solution, but i guess till i don't undesand it i can't solve it.
package com.codegym.task.task04.task0416;
/*
Crossing the road blindly
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
Scanner s = new Scanner(System.in);
double t = s.nextDouble();
double a = (t/5.00);
double b = 0;
b= t-(a*5);
//Se divisibile per 3 è yellow, se divisibile per 4 è red e in tutti gli altri casi green
if (t%3==0)
System.out.println("yellow");
else if(t%4==0)
System.out.println("red");
else
System.out.println("green");
}
}