> 其他 >
JAVA 输入一个数,并求其平方根,写出代码~
人气:276 ℃ 时间:2020-10-01 12:02:26
解答
class Test
{
public static void main(String[] args)
{
Scanner in=new Scanner(System.in);
System.out.print("请输入一个大于等于0的数:");
double num=in.nextDouble();
System.out.printf("%.3f\r\n",Math.sqrt(num));
}

}
推荐
猜你喜欢
© 2025 79432.Com All Rights Reserved.
电脑版|手机版