자바15 2차배열 (각 반의 점수 얻기) + (향상된 for문) 2023. 6. 25. 배열 (최고점수, 최저점수, 점수총합, 점수평균 구하기) public class ArrayTest { public static void main(String[] args) { //최고점수, 최저점수, 점수총합, 점수평균 구하기 int[] scoreList = {32, 40, 50, 30, 28, 100}; //점수배열 int maxScore = 0; //최고점수 int minScore = 100; //최저점수 int sumScore = 0; //점수총합 int avgScore; //점수평균 for(int i = 0; i 2023. 6. 24. 배열 (향상된 for문 이용하기) public class ArrayTest { //ArrayTest 클래스 public static void main(String[] args) { //메인메서드 int[] scoreList = {10, 20, 30, 40, 50}; //int 타입에 scoreList라는 배열 안에 10, 20, 30, 40, 50 넣기 for (int i=0; i 2023. 6. 24. 이전 1 2 3 4 5 다음