2025-03-06 22:45:14 +08:00

26 lines
464 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
一小球从100米落下每次弹跳原来一半高求第10次落地时经过的距离及第10次弹跳的高度。
使用for循环
-------------------------------------------------------*/
#include <stdio.h>
main()
{
int i;
double h,s;
s=100;
h=50;
/**********Program**********/
for(i=0;i<9;i++){
s+=h*2;
h/=2;
}
/********** End **********/
printf("第10次落地时经过的距离为%f米第10次弹跳的高度为%f米\n",s,h);
}