public class Second { public static void main(String[] args){ int[]a={0,1,2,3,4,5,6,7,8,9}; double sum=0; for(int i=0;i<a.length;i++){ sum=sum+a[i]; } System.out.println(sum/10); } }
时间: 2024-12-15 18:13:26
public class Second { public static void main(String[] args){ int[]a={0,1,2,3,4,5,6,7,8,9}; double sum=0; for(int i=0;i<a.length;i++){ sum=sum+a[i]; } System.out.println(sum/10); } }