class Prog {
public static void main(String[] args) {
double sum = 0.0;
int x = 10;
for (int i = 1;i <= x;i++ ) {
sum += high(i);
}
double y = high(11);
System.out.println("第"+x+"次落地时,共经过"+sum+"米");
System.out.println("第"+x+"次反弹"+y+"米");
}
public static double high(int x) {
double a = 100.0;
for (int i = 1;i < x;i++ ) {
a /= 2;
}
return a;
}
}