-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray50.java
More file actions
27 lines (23 loc) · 594 Bytes
/
Array50.java
File metadata and controls
27 lines (23 loc) · 594 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package array;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Name -> Array50
* Copyright © : 6/25/2022
*/
public class Array50 {
public static void main(String[] args) {
array50(new int[]{1,3,5,2,5,61});//4,5,3,6
}
public static void array50(int[] array) {
int num = 0;
for (int i = 0; i < array.length-1; ++i) {
for (int j = i + 1; j < array.length; ++j) {
if (array[i]>array[j]){//
num++;
}
}
}
System.out.println(num);
}
}