public class Min {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
float score[];
score=new float[5];
float min=0;
score[0]=89;
score[1]=99;
score[2]=65;
score[3]=59;
score[4]=70;
for(int i=0;i<5;i++) {
if(min>score[i])
min=score[i];
}
System.out.println(min);
}
}
public int min(int[] a){
int b = a[0];
for(int i = 1; i
}
}
return b;
}
public class min {
public static void main(String[] args) {
float score[];
score = new float[5];
score[0] = 89.0f;
score[1] = 99.0f;
score[2] = 65.0f;
score[3] = 59.0f;
score[4] = 70.0f;
float min = score[0];
for (int i = 0; i < 5; i++) {
if (min > score[i]) {
min = score[i];
}
}
System.out.println(min);
}
}
数组越界
应该是 i < 5