Blogger Information
Blog 13
fans 1
comment 0
visits 8558
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
20190326-js基础1_作业
蛋炒饭的博客
Original
658 people have browsed it

实例1,计算是否是闰年,能被4整除但不能被100整除的是闰年

      function run($year){
            if(($year%4==0) && ($year%100 != 0)){
                alert('是闰年');
            }else{
                alert('不是闰年');
            }
        }
        //alert();
        run(2004);

运行实例 »

点击 "运行实例" 按钮查看在线实例

实例 优秀(90-100)、良好(80-89)、良(70-79)、及格(60-69)、不及格(0-59

        function grade($score){
            if($score>=90 && $score<=100){
                alert('优秀');
            }else if($score>=80 && $score<=89){
                alert('良好');
            }else if($score>=70 && $score<=79){
                alert('良');
            }else if($score>=60 && $score<=69){
                alert('及格');
            }else if($score>=0 && $score<=59){
                alert('不及格');
            }else{
                alert('没考试');
            }
        }

        grade(65);

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post