こんにちは、17 で割り切れる数字を出力しなければならないという問題がありますが、5 つの数字を出力してから次の行にジャンプしたいと考えています。これは私が持っているコードで、なぜ機能しないのかわかりません....
public class seventeen {
public static void main(String[] args) {
int num = 17;
System.out.print("The Numbers Divisible By 17 are: ");
int enter = 0;
for (int x = 1; x <= 10000; x++) {
if (x % num == 0) {
System.out.print(x + " ");
}
enter++;
if (enter == 5) {
enter = 0;
System.out.println();
}
}
}
}