我这个为啥全都输出出去了
public static void main(String[] args) {
int[] hobbies = { 1,2,3,4,12,33,111 };
int max=hobbies[0];
for(int i=0;i<hobbies.length;i++) {
if(hobbies[i]>max) {
max=hobbies[i];
}
System.out.println(max);
}
}
public static void main(String[] args) {
int[] hobbies = { 1,2,3,4,12,33,111 };
int max=hobbies[0];
for(int i=0;i<hobbies.length;i++) {
if(hobbies[i]>max) {
max=hobbies[i];
}
System.out.println(max);
}
}
2019-09-25
举报