1个回答
展开全部
public static void main(String[] args) {
int k;
System.out.print("请输入第一个数:");
Scanner str1 = new Scanner(System.in);
int max = Integer.parseInt(str1.next());
System.out.print("请输入第二个数:");
Scanner str2 = new Scanner(System.in);
int min = Integer.parseInt(str2.next());
if(max < min ){
k=max;
max= min;
min = k;
}
System.out.print("请输入第三个数:");
Scanner str3 = new Scanner(System.in);
int mid = Integer.parseInt(str3.next());
if(mid>max){
k=max;
max= mid;
mid = k;
}else if(mid<min){
k=mid;
mid= min;
min = k;
}
System.out.println("max:"+max+",mid:"+mid+",min:"+min);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询