#include
#define INIT_H 100.0
int main()
{
double h=INIT_H,d=0;
for(int i=1;i<=10;i++)
{
d+=3*h/2;
h/=2;
}
printf("distance travelled:%.1flm\nrebound weight:%.1flm",d-h,h);
return 0;
}
#include
int main()
{
double h = 100, s;
int i;
s = h;
for(i = 1; i < 10; i ++)
{
s += h;
h/2;
}
printf("%lf, %lf\n", s, h);
return 0;
}