0
点赞
收藏
分享

微信扫一扫

Calculate the geometric mean of inputs a and b. The geometric mean of two numbers

计算输入a和b的几何平均值。两个数字的几何平均值是a * b的平方根。

import java.util.*;
import java.io.*;
import java.math.*;

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Solution {

    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();

        // Write an answer using System.out.println()
        // To debug: System.err.println("Debug messages...");

        System.out.println((int)Math.sqrt(a*b));
    }
}

举报

相关推荐

0 条评论