题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#

求小球落地5次后所经历的路程和第5次反弹的高度

http://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446

import java.util.Scanner;
public class Main{

public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    while (scanner.hasNext()) {
        int height = scanner.nextInt();
        System.out.println(2.875*height);
        System.out.println(0.03125*height);
    }
}

}

全部评论
2.875和0.03125怎么来的,这样也行?
点赞 回复 分享
发布于 2024-07-18 23:43 北京
while没有必要,删掉也可以
点赞 回复 分享
发布于 2022-04-23 01:51

相关推荐

11-13 10:17
门头沟学院 Java
昨天面美团,jvm,juc问的好深啊,感觉小林coding不太够喔,牛油们有没有什么推荐的八股网站嘛🕒 岗位/面试时间👥 面试题目🤔 面试感受
明天不下雨了:小林Coding:https://xiaolincoding.com/ 全栈哥:https://www.pdai.tech/ Guide哥:https://javaguide.cn/ 秀哥:https://interviewguide.cn/ 沉默王二:https://javabetter.cn/home.html 磊哥:https://www.javacn.site/interview/basic/ 小傅哥:https://bugstack.cn/ 源码哥:https://doocs.github.io/source-code-hunter/#/ 各大厂的公众号技术文章和一些经典的书籍
面试太紧张了怎么办?
点赞 评论 收藏
分享
迷茫的大四🐶:看来已经准备换人了
点赞 评论 收藏
分享
评论
6
1
分享

创作者周榜

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