一小球从100米高度自由落下,每次落地后反跳回原高度的一半,然后再落地再反弹……求该球经过几次落地后,其反弹的高度为0(反弹的高度小于1.0e-6))
你题目的解答代码如下:(如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮)
#include <stdio.h>
int main(){
double n = 100.0;
int c=0;
while (n>=1.0e-6)
{
n /= 2.0;
c++;
printf("第%d次反弹%.7f米\n", c,n);
}
printf("球经过 %d 次落地后,其反弹的高度为0\n", c);
return 0;
}