import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a =sc.nextInt(); int b =sc.nextInt(); int c =sc.nextInt(); int t=0; if(a>b) { t=a; a=b; b=t; } if(a>c) { t=a; a=c; c=t; } if(b>c) { t=b; b=c; c=t; } System.out.println(b);//先排序再输出排序后的中间数b //int zhong= a>b?(a<c?a:(b>c?b:c)):(b<c?b:(a>c?a:c));//三目运算符 //System.out.println(zhong); } }
时间: 2024-10-11 07:15:29