View Code of Problem 72

#include<iostream>
using namespace std;
int main(){
	double m,n,s=0;
	cin>>m>>n;
	s=m;
	for(int i=1;i<n;i++){
		m=m/2;
		s+=m*2;
		
	}
	printf("%.2f %.2f",m/2,s);
	return 0;
}

Double click to view unformatted code.


Back to problem 72