public static void main(String[] args) { aaa hello = new aaa(); int ss=hello.getMaxAge(); System.out.println("最大年龄为:" + ss); } public int getMaxAge() { int ages[]={18,23,21,19,25,29,17}; int maxScore=ages[0]; for(int i=0;i<=ages.length;i++) if(ages[i]>maxScore) {maxScore=ages[i];} return maxScore; }
添加回答
举报
0/150
提交
取消