请问怎么连续用键盘输入?Can you tell me how to use the keyboard to input continuously?
package zh.codegym.task.task04.task0416;
/*
蒙眼过马路
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(System.in);
double a =input.nextDouble();
if( a % 5 <= 3)
{
System.out.println("绿色");
}
else if( a % 5 <=4)
{
System.out.println("黄色");
}
else
{
System.out.println("红色");
}//在此编写你的代码
}
}