View Code of Problem 72

#include<stdio.h>

int main(){
	int n;
	double m,sum=0;
	scanf("%lf %d",&m,&n);	
	while(n){
		sum += m;
		m /= 2;
		if(n!=1)
			sum += m;
		
		n--;
	}
	printf("%.2f %.2f",m,sum);	
	return 0;
}

Double click to view unformatted code.


Back to problem 72