获取三个数据的最大值

       public class IfTest{

               public static void main(String[] args){

                      int a = 100;

                      int b = 150;

                      int c = 200;

                      //三元实现

                      itn temp = (a > b) ? a : b;

                      itn max = (temp > c) ? temp : c;

                      System.out.println("max:"+max);

                     

                      //if语句改进

                      int max1;

                      if(a > b){

                            if(a > c){

                             max1 = a;

                            }else{

                             max1 = c;

                            }

                            }else{

                            if(b > c){

                            max1 = b;

                           }else{

                           max1 = c;

                           }

                           System.out.println("max1:"+max1);

                     }

               }  

        }

原文地址:https://www.cnblogs.com/BruningHUA/p/6760531.html