View Code of Problem 72

#include<iostream>
using namespace std;

int main(void)
{
  int m,n;
  double h,sum;
  cin>>m>>n;
  h=m;sum=0;
  while(n--)
  {
    sum+=h*2;
    h/=2.0;
  }
  printf("%.2lf %.2lf",h,sum-m);
}

Double click to view unformatted code.


Back to problem 72