java练习7

来源:互联网 发布:shinee 知乎 综艺 编辑:程序博客网 时间:2024/04/30 06:24
/**
 * 三个数的最大值
 *
 * @author Administrator
 *
 */
public class Test6_155 {
    public static void main(String[] args) {
        /*int[] a={12,21,30};
      int max=a[0];
      for(int i=0;i<3;i++){
          if(a[i]>max){
              max=a[i];
          }
      }*/
        int a=10,b=32,c=46;
        int max=0;
        if(a>b){
            max=a;
            if(c>max){
                max=c;
            }
            else{
                System.out.println(max);
            }
        }
        else{
            max=b;
            if(c>max){
                max=c;
            }
            else{
                System.out.println(max);
            }
        }
      System.out.println(max);
    }
}

0 0