I Tried on jdoodle.com and it's all Ok
Used the example values at "conditions" and got the right answers
package com.codegym.task.task04.task0415;
/*
Rule of the triangle
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String sa = br.readLine();
double a=Double.parseDouble(sa);
while( a >= 5 ) {
a-=5;
}
if (a>=4) System.out.println("red");
else {
if (a>=3) System.out.println("yellow");
else {
System.out.println("green");
}
}
}
}