View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72