Bajardi: Saidov S


Download 204.53 Kb.
bet3/3
Sana14.02.2023
Hajmi204.53 Kb.
#1198423
1   2   3
int row = scanner.nextInt();
System.out.println("massive dagi ustun sonini kiriting");
int column = scanner.nextInt();
int[][] array = new int[row][column];
var counter = 0;
var min = Math.min(row, column);
var max = Math.max(row, column);

for (int i = 0; i < row; i++) {
for (int j = 0; j < column; j++) {
array[i][j] =-1000+ (int) (Math.random() * 2001);
if (array[i][j] >= min && array[i][j] <= max) {
counter++;
}
}
}
System.out.println(Arrays.deepToString(array));
System.out.println(counter);
}
}


Natija:


Download 204.53 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling