The method sqrt(double) is undefined for the type Main

出错代码

r2=(-b-sqrt(b*b-4*a*c))/2*a;

正确代码

r2=(-b-Math.sqrt(b*b-4*a*c))/2*a;

 

posted @ 2020-02-08 15:10  七只蚂蚁  阅读(784)  评论(0)    收藏  举报