View Code of Problem 72

#include <stdio.h>
#include <string.h>
#include <math.h>  
int main()
{
	int i;
	double aa=0;
	double m,n,h;
	 scanf("%lf %lf",&m,&n);
	 for(i=0;i<n;i++)
	 {
		 if(i==0)
		 {
			 aa+=m;
		 }
		 else
		 {
			 aa=aa+2*m;
		 }
		 m=m/2;
	 }
	 printf("%.2lf %.2lf\n",m,aa);
    	 
} 

Double click to view unformatted code.


Back to problem 72