/*
* 47.cpp
*
* Created on: 2011-8-8
* Author: san
*/
# include <stdio.h>
int main(void)
{
int i;
float h = 100;
float s = 100;
for (i=1; i<=9; i++)
{
h = h / 2;
s += h * 2;
}
printf("总共经过的路程:%f\n", s);
printf("最后一次反弹:%f", h/2);
return 0;
}
* 47.cpp
*
* Created on: 2011-8-8
* Author: san
*/
# include <stdio.h>
int main(void)
{
int i;
float h = 100;
float s = 100;
for (i=1; i<=9; i++)
{
h = h / 2;
s += h * 2;
}
printf("总共经过的路程:%f\n", s);
printf("最后一次反弹:%f", h/2);
return 0;
}