View Code of Problem 72

#include<stdio.h>
int main(){
	int n;
	float h,m,sum;
	scanf("%f %d",&m,&n);
	for(int i=1;i<=n;i++){
		h = m/2;
		sum += m+h;
		m = h;
		
	}
	printf("%.2f %.2f\n",h,sum-h); 
	return 0;
}

Double click to view unformatted code.


Back to problem 72