View Code of Problem 72

#include<iostream>
using namespace std;
int main(){
	float M;int N;
	cin>>M>>N;
	float sum=M;
	for(int i=1;i<N;i++){
		M=M/2;
		sum=sum+M*2;

	}
	printf("%.2f %.2f",M/2,sum);
}

Double click to view unformatted code.


Back to problem 72