import java.util.Scanner; public class Text01 { public static void main(String[] args) { int[]moeny=new int[4]; int temp=0; Scanner sc=new Scanner(System.in); System.out.println("请输入4家店的价格"); for(int i=0;i<moeny.length;i++) { moeny[i]=sc.nextInt(); } for(int i=0;i<moeny.length;i++) { if (moeny[0]>moeny[i]){ temp=moeny[0]; moeny[0]=moeny[i]; moeny[i]=temp; } if (i==3){ System.out.println("最低价格为"+moeny[0]); } } } }
11-13
818
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-10
892
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)