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?(ac?b:c)):(bc?a:c));//三目运算符
//System.out.println(zhong);
}
}
原文:http://blog.csdn.net/u012110719/article/details/41171851