一个游戏,前20关是每一关自身的分数,
//21-30关每一关是10分
//31-40关,每一关是20分
//41-49关,每一关是30分
//50关,是100分
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> </body> </html> <script type="text/javascript"> var guanQia = parseInt(prompt("请输入第几关")) if (guanQia<=20) { alert(guanQia) } else if (guanQia>20 && guanQia<=30 ){ (guanQia=(guanQia-20)*10+20) alert(guanQia) } else if (guanQia>30 && guanQia<=40){ (guanQia=(guanQia-30)*20+120) alert(guanQia) } else if (guanQia>40 && guanQia<=49){ (guanQia=(guanQia-40)*30+320) alert(guanQia) } else if (guanQia=50){ (guanQia=100+590) alert(guanQia) } </script>