我尝试在运行扫描仪之前发出输出命令,但是它仍然无法打开。正在运行bluej
import java.util.Scanner;
class dowhifactor
{
public static void main()
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter a number to find out all it's factors");
int num = sc.nextInt();
int i = 1;
do
{
if (num % i == 0)
{
System.out.println("Found factor: " +i);
}
i++;
}
while (i<=num);
}
}