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.
pgflzu36e/B.java

27 lines
528 B

4 years ago
package logax;
import java.util.Scanner;
public class B {
static public class Logarithm {
static public double log(double a, double x) {
return Math.log(a) / Math.log(x);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("a=");
int a = sc.nextInt();
System.out.println("x=");
int x = sc.nextInt();
System.out.println("logax="+Logarithm.log(a,x));
}
}