This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
//package log;
import java.util.Scanner;
public class b {
public static void main(String[] args) {
int a;
int x;
double result;
System.out.println("输入底数a(a>0且a!=1):");
Scanner sc = new Scanner(System.in);
a=sc.nextInt();
System.out.println("输入真数x:");
x=sc.nextInt();
result = log(x, a);
System.out.println(result);
}
private static double log(double value, double base) {
return Math.log10(value) / Math.log10(base);