View Code of Problem 115

#include<stdio.h>
int main()
{
  int n;
  while(scanf("%d",&n)!=EOF)
  {
    int rich=0,poor=0,a=1;;
    for(int i=1;i<=n;i++)
    {
      poor+=a;
      a=a*2;
      rich+=100000;
    }
    printf("%d %d\n",poor,rich);
  }
  return 0;
}

Double click to view unformatted code.


Back to problem 115