述 | |
---|---|
知识点 | 循环 |
运行时间限制 | 10M |
内存限制 | 128 |
输入 | 待求解参数 double类型 |
输出 | 输入参数的立方根 也是double类型 |
样例输入 | 216 |
样例输出 | 6.0 |
/*求解立方根,java中直接调用Math.cbrt(double a)方法就可以了*/
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double intput = scanner.nextDouble();
double output = Math.cbrt(intput);
System.out.printf("%.1f", output); //输出小数点保留一位
scanner.close();
}
}