它可以完美编译,没有错误,但是当我运行它时它仍然没有打开终端窗口

时间:2019-10-02 17:32:37

标签: java bluej

我尝试在运行扫描仪之前发出输出命令,但是它仍然无法打开。正在运行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);
    }
}

0 个答案:

没有答案