13 个答案
懒懒的喵喵咪
答案时间:2021-01-25
public class HelloWorld {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a[]=new int[5];
int result = 0;
for(int i=0;i<=4;i++) {
a[i]=(int)(Math.random()*100);
System.out.print(a[i]);
System.out.print(' ');
}
for(int i=1;i<=4;i++) {
if(a[i]
result=a[i];
}
System.out.println();
System.out.printf("输出数组中的最小值:%d",result);
System.out.print("输出数组中的最小值:"+result);
}
}
spieluhr
答案时间:2021-01-16
public class MinNum {
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 = 666;
System.out.println("数组中的各个随机数是:");
for(int i = 0; i < 5; i++){
System.out.println(a[i]);
min=min