You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
376 B
16 lines
376 B
package guangzhaowei;
|
|
|
|
import java.util.Scanner;
|
|
|
|
public class Logarithm {
|
|
public static void log() {
|
|
Scanner sc= new Scanner(System.in);
|
|
System.out.println("请输入对数:");
|
|
double base=sc.nextDouble();
|
|
System.out.println("请输入真数:");
|
|
double value=sc.nextDouble();
|
|
double result=Math.log(value)/Math.log(base);
|
|
System.out.println("运算结果是"+result);
|
|
}
|
|
}
|