From c0d4cdcaf8bb1ade7510ea58d186ee8af69d1d11 Mon Sep 17 00:00:00 2001 From: your name Date: Fri, 7 Aug 2020 01:14:29 +0800 Subject: [PATCH] first --- B.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 B.java diff --git a/B.java b/B.java new file mode 100644 index 0000000..83e0cbf --- /dev/null +++ b/B.java @@ -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)); + + + } + +}