zoukankan      html  css  js  c++  java
  • day9

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title></title>
    </head>
    <body>
    <!--<script>
    function ji(){
    var sum=0;
    for(var i=1;i<100;i=i+2){
    sum=sum+i;
    }
    document.write("100以内奇数求和为"+sum);
    }
    </script>
    <button onclick="ji()">100以内奇数求和为</button>-->
    <script>
    function ou(){
    var sum=0;
    for(var i=1;i<=100;i=i+1){
    if(i%2==0){
    sum=sum+i;
    }
    }
    document.write("100以内的偶数求和为"+sum);
    }
    </script>
    <button onclick="ou()">100以内偶数求和为</button>
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    <body>
    <script>
    function caishu(){
    var a=parseInt(Math.random()*100);
    var cishu=0;
    for(;;){
    cishu=cishu+1;
    var b=prompt("请输入你猜的数字1-100");
    if(b<a){
    alert("你输入的小了");
    }else if(b>a){
    alert("你输入的大了");
    }else{
    alert("恭喜你才对了");
    break;
    }
    if(cishu==10){
    document.write("不好意思你输得次数多了")
    break;
    }
    }
    document.write("你共输入"+cishu+"次数")
    }
    </script>
    <button onclick="caishu()">次数</button>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    <body>
    <script>
    function xinhang(){
    for(;;){
    var a=prompt("---1查询---2取款---3转账----0退出--");
    if(a==1){
    alert("查询");
    }else if(a==2){
    alert("取款");
    }else if(a==3){
    alert("转账");
    }else if(a==0){
    alert("退出");
    break;
    }else{
    alert("你输入错误请从新输入");
    }
    }
    }
    </script>
    <button onclick="xinhang()">客服</button>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    <body>
    <script>
    function shui(){
    var shui=parseInt(prompt("个人月收入"));
    if(shui<=3500){
    alert("你好你免税");
    }else if(shui<=5000){
    shui=(shui-3500)*0.03;
    alert("你好你交税"+shui);
    }else if( shui<=9000){
    shui=(5000-3500)*0.03+(shui-5000)*0.1;
    alert("你好你交税"+shui);
    }else if( shui>9000){
    shui=(5000-3500)*0.03+(9000-5000)*0.1+(shui-9000)*0.2;
    alert("你好你交税"+shui);
    }
    }
    </script>
    <button onclick="shui()">税收查询</button>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    <body>
    <script>
    function koujue(){
    var a=prompt("请输入数字");
    var num=0;
    for(var b=1;b<=a;b++){
    num=b*a
    document.write(b+"*"+a+"="+num);
    document.write('<br/>');
    }
    }
    </script>
    <button onclick="koujue()">乘法</button>
    </body>
    </html>

  • 相关阅读:
    netstat命令
    为什么 netstat 对某些服务只显示了 tcp6 监听端口
    端口状态说明 LISTENING、ESTABLISHED、TIME_WAIT及CLOSE_WAIT
    进程启动时主线程创建过程分析
    [Kali]关机卡死,google拼音无法输入
    [白帽子讲WEB安全]XSS <Cross Site Script>
    [白帽子将WEB安全笔记]浏览器安全
    [白帽子将WEB安全笔记]我的安全世界观
    mongodb高可用集群 3 ---分片与副本集结合
    python计算年龄小程序
  • 原文地址:https://www.cnblogs.com/hfew/p/10520750.html
Copyright © 2011-2022 走看看