题解 | #搬圆桌#

搬圆桌

http://www.nowcoder.com/practice/81bb01ef2bb144808a8277e9164a0886

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()) {
            int r = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int x1 = sc.nextInt();
            int y1 = sc.nextInt();
            double dis = Math.sqrt(Math.pow(x1 - x, 2) + Math.pow(y1 - y, 2));
            double cnt = dis / r / 2;
            System.out.println((int)Math.ceil(cnt));
        }
    }
}
全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 11:21
被夸真的超级开心,好可爱的姐姐
码农索隆:老色批们不用脑补了,我把金智妮的图找来了查看图片
点赞 评论 收藏
分享
晗江雪:其实我只是觉得你们导员说的很好笑
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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