0
就像标题所说的,我试图编写一个程序,该程序需要两个数字并找出可以被另一个数字整除的程序。例如:我输入x作为第一个整数,y输入我的最后一个整数。然后我要求程序找出这两个可被z整除的数字之间的所有内容。所以,如果我说的数字1和10的2 2,4,6,8和10之间分割所以它的输出不包括这是我迄今为止需要在两个整数之间生成整除
Scanner kb = new Scanner(System.in);
System.out.print("Please enter two integers seperated by space(s): ");
int num1 = kb.nextInt();
int num2 = kb.nextInt();
System.out.print("\nPlease enter the integer your output should be divisible by: ");
int divisor = kb.nextInt(); //asking for the divisor
for (int i =num1+1; i<num2; i++)
{
System.out.println(i);
}