数组函数
来源:互联网 发布:女生提气质知乎 编辑:程序博客网 时间:2024/06/05 11:10
public class ArrayVoluation {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] a = { 1, 2, 3, 4, 6, 8, 9, 7, 5, 11 };
System.out.println("原数组遍历: ");
for (int j : a) {
System.out.print(j + " ");
}
int[] newArray = count(a);
System.out.println();
System.out.println("新数组遍历为: ");
for (int i : newArray) {
System.out.print(i + " ");
}
}
public static int[] count(int[] b) {
int sum = 0;
for (int i = 0; i < b.length; i++) {
sum += b[i];
}
b[0] = sum;
return b;
}
}
0 0
- 数组函数
- 数组函数
- 函数数组
- 函数、数组
- 函数数组
- 函数数组
- 函数 ,数组
- 数组函数
- 数组函数
- 函数数组
- 数组函数
- 数组函数
- 数组函数
- 数组函数
- 函数、数组
- 数组函数
- 函数数组
- 函数数组
- poj 3694 Network (tarjan+树链剖分)
- 如何在浏览器控制台(console)里输出彩色样式调试信息
- Python类属性,实例属性
- Android中常用的优秀开源框架
- 简单说下越界访问的调试方法
- 数组函数
- 嗯,记一道水题
- 从JDK源码分析Java中的equals与hashCode
- 高通LCD之背光
- 前端.进度条样式的原理与解释
- Codeforce 486D(树形dp)
- 队列的使用
- 聊聊STM32芯片的DFU编程及相关话题
- OverTheWire的Natas题