在信老师和信自己之间我选择了---信代码

马上期末考试了,博主为大家预测一波考试成绩(多次取最大值喔[偷笑.jpg])。

源码奉上 

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      margin: 300px auto;
      display: flex;
      justify-content: space-around;
      height: 300px;
      width: 500px;
      border-left: 2px solid #000;
      border-bottom: 2px solid #000;
      align-items: flex-end;
    }

    .box div {
      display: flex;
      background-color: #e0e0e0;
      flex-direction: column;
      text-align: center;
      justify-content: space-between;
    }

    .box div span {
      margin-top: -20px;
      width: 40px;
      text-align: center;
    }

    .box div h4 {
      margin-bottom: -20px;
      width: 40px;
      text-align: center;
    }
  </style>
</head>

<body>
  <script>
    let sub = null
    let i = 1
    document.write(
      `<div class="box">`
    )
    while (sub = prompt(`请输入第${i++}个学科(输入空或者取消停止输入)`)) { //为sub更新值并作为循环的条件 若不输则为空 即false
      let score = Math.floor(Math.random() * 40 + 61)  //在60 - 100之间随机生成一个数字
      document.write(`
      <div style="height: ${score}px;">
        <span>${score}</span>
        <h4>${sub}</h4>
      </div>
      `)
    }
    document.write(
      `</div>`
    )

    alert("准备好了么")
    let arr = [3, 2, 1]
    for (let k in arr) {
      alert(arr[k])
    }


  </script>
</body>

</html>

 祝大家期末关关难过关关过!!!!!!

 

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值