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); } }