zoukankan      html  css  js  c++  java
  • 面向对象;

    import Test.Tuzi;

    public class Tuzi1 {

        public String sex;

        public int height;

       public double weight;

       public void show(){

          if("男".equals(sex)){

            if(weight<(height-103)){   

             System.out.println("你的标准身高:"+(height-103)+"~"+(height-97)+"你该增肥了奥");

              }else if(weight>(height-97)){   

             System.out.println("你的标准身高:"+(height-103)+"~"+(height-97)+"亲爱的小猪猪,好像是该减肥了啊");

              }else{    System.out.println("嗯,不错,你很标准呢");  

       }

     }   else if("女".equals(sex)){     

        if(weight<(height-113)){  

           System.out.println("你的标准身高:"+(height-113)+"~"+(height-107)+"你该增肥了奥");  

        }else if(weight>(height-107)){   

          System.out.println("你的标准身高:"+(height-113)+"~"+(height-107)+"亲爱的小猪猪,好像是该减肥了啊");  

        }else{   System.out.println("嗯,不错,你很标准呢");

     }

       }else{  

         System.out.println("傻子,连自己性别都不知道吗?赶紧回家问问你妈");

     }

    }  

    public class Tuzi2 {
       public static void main(String[] args) {
          Tuzi1 q=new Tuzi1();
          q.sex="女";
          q.height=160;
        q.weight=320;
        q.show();
     }
    }

    }

  • 相关阅读:
    Oracle创建database link(dblink)和同义词(synonym)
    spring boot 集成 quartz 定时任务
    tomcat 启动Spring boot 项目
    UUID+随机数
    js常用字符串处理方法
    Win10安装mysql-8.0.11-winx64详细步骤
    ORA-02049: 超时: 分布式事务处理等待锁
    spring boot 发邮件
    bootstrap table 列求和
    spring boot 延长 Session 时间
  • 原文地址:https://www.cnblogs.com/hljj/p/6858631.html
Copyright © 2011-2022 走看看