标签:body bsp doctype 输入 head else mat doc html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
</html>
<script>
a=prompt("请输入a","")
b=prompt("请输入b","")
c=prompt("请输入c","")
a = parseInt(a);
b = parseInt(b);
c = parseInt(c);
d=-b
e=2*a
x=b*b-4*a*c
y=d/e
z=Math.sqrt(x)
f=d+z
g=d-z
h=f/e
i=g/e
if(x<0){
alert("无实根")
}
else{
if(x==0){
alert(y)
}
else{
if(x>0){
alert(h+","+i)
}
}
}
</script>
标签:body bsp doctype 输入 head else mat doc html
原文地址:http://www.cnblogs.com/sglq/p/7220496.html