package com.cetc55; public class Dome4 { public static void main(String[] args) { int num = 0; int[] array = { 14, 124, 141, 24, 14, 124, 14, 1, 4 }; for (int i = 0; i < array.length; i++) { if (array[i] > i) { num+=array[i]; } System.out.println(array.length); } System.out.println("數組中的和爲:" + num); } }