1 条题解

  • 0
    @ 2024-12-24 10:06:18

    C++ :

    #include <iostream>
    using namespace std;
    
    int main() {
    	double h, s;
    	cin >> h;
    	int n = 1;
    	s = h;
    	while (n < 10) {
    		h/=2;
    		s+=h*2;
    		n=n+1;
    //		cout<<h<<endl;
    	}
    	cout << s <<endl;
    	cout << h/2 <<endl;	
    }
    
    • 1

    信息

    ID
    2596
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者