提交时间:2024-05-12 17:10:43

运行 ID: 47156

#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; cout<<h; return 0; }