Advertisement
DanikYakush

Task22

Jul 5th, 2022
736
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Random;
  2. import java.util.Scanner;
  3.  
  4. public class Task22 {
  5.     public static void main(String[] args) {
  6.         int n, k;
  7.         Random rand = new Random();
  8.         Scanner in = new Scanner(System.in);
  9.         n = in.nextInt();
  10.         k = in.nextInt();
  11.         int[] array = new int[n];
  12.         for (int i = 0; i < n; i++) {
  13.             array[i] = rand.nextInt(1, 100);
  14.             if(array[i] > i) System.out.println(array[i]);
  15.         }
  16.     }
  17. }
  18.  
Advertisement
RAW Paste Data Copied
Advertisement