java 简单比较

2019年2月12日21:53:44 发表评论 1,593 views
/**
 * Created by xabcd on 2019/2/12.
 */
public class TestJava_bijiao
{public static void main(String[] args)
{
    int a = 5,b= 6,max;
    max = (a>b)?a:b;
    System.out.println("最大的数是"+max);
}
}


结果
最大的数是6

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: