Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
|
c0d4cdcaf8 | 5 years ago |
@ -0,0 +1,26 @@
|
|||||||
|
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));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue