zoukankan      html  css  js  c++  java
  • 用函数调用循环语句if..else与多重if语句的用法

    <script>

    //..............................判断用户输入的年份是否是闰年.....................................

      function getYear(){

        var year=prompt("请输入年份");

        if((year%4==0&&yeat%100!=0)||year%400==0){

          alert("今年是闰年");

        }else{  

          alert("今年不是闰年");  

        }

      }

    //.........................................米莱托指数.................................................................

      function getWeight(){

        var height=prompt("请您输入您的身高");

        var weight=prompt("请您输入您的身高"); 

        var calc=weight/(height*height);

        if(calc>25){

          alert("偏胖");

        }else if(calc<20){

          alert("偏瘦");

        }else{

          alert("标准体重");

        }

      }

    </script>

    <button onclick="getYear()"></button>

  • 相关阅读:
    Notepadd ++ PluginManager安装
    Srping cloud Ribbon 自定义负载均衡
    Spring cloud Eureka 和 Zookeeper 比较
    Spring cloud info信息显示
    kafka 在Windows端安装 找不到或无法加载主类 的解决方案
    Linux kafka 单机安装
    mina
    @bzoj
    @51nod
    @topcoder
  • 原文地址:https://www.cnblogs.com/luYing666/p/10237492.html
Copyright © 2011-2022 走看看