1 solutions

  • 0
    @ 2025-11-5 18:29:56

    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

    Information

    ID
    18891
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By