package java练习;
public class 遍历数组 {
public static void main(String[] args) {
int a[]=new int[5];
a[0]=(int) (Math.random() * 100);
a[1]=(int) (Math.random() * 100);
a[2]=(int) (Math.random() * 100);
a[3]=(int) (Math.random() * 100);
a[4]=(int) (Math.random() * 100);
int MIN=a[0];
for(int i=0;i<a.length;i++){
if(MIN>a[i]){
MIN=a[i];
}
System.out.println("数组中的随机数为:"+a[i]);
}
System.out.println("最小数为:"+MIN);
}
}