View Code of Problem 72

#include<stdio.h>
int main()
{
	int i,n,m;
    double h,s;
	scanf("%d %d",&m,&n); 
	h = m;
	s= m;
	for(i=1;i<=n;i++)     
	{
		h*=0.5;
		if(i==1)
			continue;
		s=4*h+s;
	}    
	printf("%.2f %.2f\n",h,s);    
	return 0;
}

Double click to view unformatted code.


Back to problem 72