public class test {
public static void main(String[] args) {
//数组遍历求和
int sum = 0;
int[] arry = new int[3];
for (int i = 0; i < 3; i++) {
arry[i] = i;
}
for (int j = 0; j < arry.length; j++) {
sum+=arry[j];
}
System.out.println(sum);
}
}
数组遍历求和
最新推荐文章于 2024-03-16 16:09:45 发布