/**
* 求出4家店的最低手机价格
*/
System.out.println("请输入4家店的价格");
int lowPrice=0;
for (int i = 1; i <= 4; i++) {
System.out.print("第"+i+"家店的价格:");
int price=input.nextInt();
if(i==1)
lowPrice=price;
if (lowPrice>price) {
lowPrice=price;
}
}
System.out.println("最低价格为:"+lowPrice);
* 求出4家店的最低手机价格
*/
System.out.println("请输入4家店的价格");
int lowPrice=0;
for (int i = 1; i <= 4; i++) {
System.out.print("第"+i+"家店的价格:");
int price=input.nextInt();
if(i==1)
lowPrice=price;
if (lowPrice>price) {
lowPrice=price;
}
}
System.out.println("最低价格为:"+lowPrice);