Advertisement
DanikYakush

Task21

Jul 5th, 2022
720
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 Task21 {
  5.     public static void main(String[] args) {
  6.         int n, k;
  7.         int max = 0;
  8.         int min = 101;
  9.         Random rand = new Random();
  10.         Scanner in = new Scanner(System.in);
  11.         n = in.nextInt();
  12.         k = in.nextInt();
  13.         int[] array = new int[n];
  14.         for (int i = 0; i < n; i++) {
  15.             array[i] = rand.nextInt(1, 100);
  16.             if(array[i] > max) max = array[i];
  17.             if(array[i] < min) min = array[i];
  18.         }
  19.  
  20.     }
  21. }
  22.  
Advertisement
RAW Paste Data Copied
Advertisement