题解 | #求平方根#

求平方根

http://www.nowcoder.com/practice/09fbfb16140b40499951f55113f2166c

import java.util.*;

public class Solution {
    /**
     *
     * @param x int整型
     * @return int整型
     */
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        System.out.println();
        int input = sc.nextInt();
        sqrt(input);
    }
    public static int sqrt(int x) {
        int y = (int) Math.sqrt(x);
        System.out.println(y);
        return y;
    }
}
全部评论

相关推荐

猫头夜鹰:图书管理系统能有面试就怪了,放十年前都不行
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务