View Code of Problem 115

#include <stdio.h>
#include <string.h>
#include <math.h>
#define N 10000
int main()
{
    int n;
    int i;
    while(scanf("%d",&n)!=EOF)
	{
		float ms=0,fh=1,sum=1;
		for(i=0;i<n;i++)
			ms+=100000;
		for(i=1;i<n;i++)
		{
			sum*=2;
			fh+=sum;
		}
		printf("%g %g\n",fh,ms);
	}
	return 0; 
}

Double click to view unformatted code.


Back to problem 115