2018.12.08作业
求出4家店的最低手机价格
package javademo2;
import java.util.Scanner;
public class A12 {
public static void main(String[] args) {
System.out.println("请输入4家店的价格");
int min = 0;
Scanner input = new Scanner(System.in);
int a[]=new int[4];
for(int i =0;i<4;i++) {
System.out.println("第"+(i+1)+"家店的价格");
int x =input.nextInt();
a[i]=x;
min=a[0];
if(min>a[i]) {
min=a[i];
}
}
System.out.println("最低价格是:"+min);
}
}