确定数字的平方根

jho*_*nne 1 java

我的作业中有以下几行代码,需要一些数字.我试图找出用于查找数字的平方根的函数.怎么做到这一点?

 System.out.println("find the value of c if:");
 Scanner kbreader=new Scanner(System.in);
 System.out.print("a="+" ");
 double a=kbreader.nextDouble();
 System.out.print("b=" + " ");
 double b=kbreader.nextDouble();
 System.out.print("c=" + " " );
 System.out.print((a*a)+(b*b));
Run Code Online (Sandbox Code Playgroud)

Bil*_*ard 5

Math.sqrt(双)

如果你要用Java编写很多东西,你会想要熟悉核心库.在Java教程是一个良好的开端.