public class Test08 { public static void main(String[] args) { int day = 1 ; double h = 0; while (h<=56.7){ h+=5; if(h<=56.7){ h-=3.5; }else { break; } day++; } System.out.println(day); } }
8、【蜗牛爬井】井里有一只蜗牛,他白天往上爬5米,晚上掉3.5 米,井深56.7米,计算蜗牛需要多少天才能从井底到爬出来。
最新推荐文章于 2023-03-06 05:13:31 发布