View Code of Problem 72

#include<bits/stdc++.h>
using namespace std;
int main(){
	double m,n,s=0;
	cin>>m>>n;
	for(int i=0;i<n;i++){
		s+=m;
		m=m/2;
		s+=m;
	}
	s-=m;
	printf("%.2f %.2f\n",m,s);
}

Double click to view unformatted code.


Back to problem 72