题解 | #数组遍历#
数组遍历
http://www.nowcoder.com/practice/0f8219cb6f6e4e99a1bb0e868e51d60a
foreach遍历数组
//write your code here......
max = ary[0];
min = ary[0];
for (int j : ary){
if(max <= j){ max = j;}
if(min >= j){ min = j;}
}
System.out.println(max+" "+min);
}
}
补充foreach知识点: http://c.biancheng.net/view/750.html