Advertisement
DanikYakush

Task17

Jul 4th, 2022
891
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None
  1. import java.util.Scanner;
  2.  
  3. public class Task17 {
  4.     public static void main(String[] args) {
  5.         int n, m, delta;
  6.         Scanner in = new Scanner(System.in);
  7.         n = in.nextInt();
  8.         delta = in.nextInt();
  9.         m = n + delta;
  10.         for (int i = n; i < m + 1; i++) {
  11.             for (int j = 2; j < i; j++) {
  12.                 if (i % j == 0) System.out.print(j + " ");
  13.                 if(j == i - 1) System.out.println();
  14.             }
  15.         }
  16.     }
  17. }
  18.  
  19.  
Advertisement
RAW Paste Data Copied
Advertisement