package cn.zhidao.impl;
import java.util.Scanner;
public class Phone {
public static void main(String[] args) {
//声明变量
double[] price = new double[4];
double min;
//循环给数组赋值
System.out.println("请一次录入4个手机价格:");
Scanner input = new Scanner(System.in);
for(int i = 0;i < 4;i++){
price[i] = input.nextDouble();
}
//计算价格最小值
min = price[0];
for(int index = 0;index < 4;index++){
if(price[index] < min){
min = price[index];
}
}
//显示最小值
System.out.println("4个手机价格中最低的是:"+min);
}
}