『代码』··By/蜜汁炒酸奶

求小球运动路径

/* 功能:求小球运动路径 日期:2013-4-19 */ #include <stdio.h> #include <stdlib.h> int main(void) { int n; double hight,s; for (hight=100.0,s=0,n=1;n<=10;n++) { hight=hight/2.0; printf(“第%d次反弹的高度:%.6lfn”,n,hight); s=s+hight; } s=s+100.0; printf(“小球共经过的路程:%.6lfn”,s); system (“pause”); return 0; }

预览
Loading comments...
0 条评论

暂无数据

example
预览