└── max /max: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | import java.util.*; 3 | 4 | public class Solution { 5 | 6 | public static void main(String[] args) { 7 | /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ 8 | Scanner sc = new Scanner(System.in); 9 | int n = sc.nextInt(); 10 | int arr [] = new int [n]; 11 | for(int i=0;i max){ 17 | max = arr[i]; 18 | } 19 | } 20 | System.out.println(max+ " is the maximum element in the array"); 21 | 22 | } 23 | } 24 | --------------------------------------------------------------------------------