public int getMaxAge() { int[] ages = {18,23,21,19,25 ,29 ,17}; int max = 0; for(int i = 0;i < ages.length;i++) if(ages[i] > ages[i+1]){ max = ages[i]; }else{ max = ages[i+1]; } return max;
添加回答
举报
0/150
提交
取消