标签:static 运行 com void 手机价格 获取 int tin 手机
代码:
import java.util.Scanner;
public class Work03 {
static Scanner input = new Scanner(System.in);
public static void main(String[] args) {
int[] price = new int[4];
System.out.println("请输入4家店的价格");
System.out.print("第1店的价格:");
price[0] = input.nextInt();
int min = price[0];
for(int i = 1;i<price.length;i++) {
System.out.print("第"+(i+1)+"店的价格:");
price[i] = input.nextInt();
if(price[i]<min) {
min = price[i];
}
}
System.out.println("最低价格是:"+min);
}
}
运行结果:
标签:static 运行 com void 手机价格 获取 int tin 手机
原文地址:https://www.cnblogs.com/Dean-0/p/11125516.html