总结:函数 Math.pow(x,0.5);

package com.badu;

import java.util.Scanner;

// 输入一个数,并计算出平方根
public class AA { public static void main(String[] args) {
Scanner c = new Scanner(System.in);
System.out.println("请输入一个数----");
double z = c.nextInt();
double y = Math.pow(z, 0.5);
System.out.println(y);
}
}

  

05-11 22:34