一球从100米高度自由落下

题目:一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在 第10次落地时,共经过多少米?第10次反弹多高?

public class Test{
    
public static void main(String args[])
    {
        
double h = 100,s=0;
        
for(int i=1;i<=10;i++){
            s = s + 
2*h;
            h=h/
2;
        }
        System.out.println(
"h is: "+h);
        System.out.println(
"s is: "+s);
    }
}

原文地址:https://www.cnblogs.com/laoquans/p/2963350.html