提交时间:2024-05-12 17:08:54

运行 ID: 47152

#include<iostream> using namespace std; int main() { double h,b=0,sum=0; cin>>h; for(int i=1;i<=10;i++){ sum=sum+h+b; h=h/2; b=h; } cout<<sum<<endl<<h; return 0; }