728x90 320x100 최댓값구하기1 배열요소의 최댓값 구하기 (chap02/MaxOfArray) 배열요소의 최댓값 구하기 package chap02; import java.util.Scanner; public class MaxOfArray { static int maxOf(int[] a){ int max = a[0]; for (int i = 0; i max) max = a[i]; } return max; } public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("키의 최댓값을 구합니다."); System.out.print("사람 수 : "); int num = scan.nextInt(); int[] height = new in.. 2022. 10. 16. 이전 1 다음 728x90 320x100