1. 程式人生 > >7.21練習2

7.21練習2

charset 輸入 set oct doctype htm else title 一點

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
<script>
x=prompt("請輸入姓名","")
y=prompt("請輸入考試成績“,”")
z="恭喜你"
a=",滿分通過!"
b="你很優秀,繼續保持!"
c="成績良好"
d="就差一點點,下次一定要至少及格!"
e="你是笨蛋嗎?"
if(y==100){
alert(z+x+a)
}
else if(y>=80&&y<100){
alert(x+b)
}
else if(y>=60&&y<80){
alert(x+c)
}
else if(y>=50&&y<60){
alert(x+d)
}
else if(y<50){
alert(x+e)
}
</script>

7.21練習2