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.

18 lines
350 B

4 years ago
import java.util.Scanner;
public class logax {
public static void main(String[] args) {
System.out.println("计算logax");
Scanner in =new Scanner(System.in);
System.out.println("输入a:");
int a=in.nextInt();
System.out.println("输入x:");
int x=in.nextInt();
System.out.println("log"+a+" "+x+" = "+(Math.log(x)/Math.log(a)));
}
}