Run ID:5901
提交时间:2024-12-21 09:24:22
#include<iostream> using namespace std; int main(){ double h=100,s=0;//h为高度,开始为100,s为经过的总路径 for(int i=1;i<=10;i++){ s=s+h+h/2; h/=2; } printf("%.6lf %.6lf",s+h,h); //这里有争议,第10次弹起后, //球再落下的高度要算入经过的总距离吗?答案是要加的 return 0; }