import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
System.out.print("Enter ten numbers: ");
Scanner input = new Scanner(System.in);
double[] numbers = new double[10];
for(int i = 0; i < numbers.length; i++)
numbers[i] = input.nextDouble();
System.out.println("The minimum number is: " + min(numbers));
}
public static double min(double[] array)
{
double min = array[0];
for(int i = 1; i < array.length; i++)
if(min > array[i])
min = array[i];
return min;
}
}
6-9 编程练习题答案
最新推荐文章于 2022-10-10 17:39:32 发布