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;
car
相关分类