-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray41.java
More file actions
25 lines (21 loc) · 550 Bytes
/
Copy pathArray41.java
File metadata and controls
25 lines (21 loc) · 550 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
package array;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Name -> Array41
* Copyright © : 6/24/2022
*/
public class Array41 {
public static void main(String[] args) {
}
public static void array41(int[] array) {
int summax = array[0] + array[1], k = 1;
for (int i = 2; i < array.length; i++) {
if (array[i-1]+array[i]>summax){
summax=array[i-1]+array[i];
k=i;
}
}
System.out.printf("%d,%d",array[k-1],array[k]);
}
}