글수 22
<html>
<head>
<title>Untitled Document</title>
<script language="javascript">
var x;
x = prompt("점수를 입력하시오..!!");
if(x>90){
document.write("수");
}else{
if(x>80){
document.write("우");
}else{
if(x>70){
document.write("미");
}else{
if(x>60){
document.write("양");
}else{
document.write("가");
}
}
}
}
</script>
</head>
<body>
</body>
</html>



// else if문을 써서 개선한 예
<html>
<head>
<title>Untitled Document</title>
<script language="javascript">
var x;
x = prompt("점수를 입력하시오..!!");
if(x>90){
document.write("수");
}else if(x>80){
document.write("우");
}else if(x>70){
document.write("미");
}else if(x>60){
document.write("양");
}else{
document.write("가");
}
</script>
</head>
<body>
</body>
</html>