View Code of Problem 115

#include <stdio.h>

#define N 100000

int main()
{
	int i;
	double n, Msum, m;

	while(scanf("%lf", &n) != EOF)
	{
		Msum = 1, m = 1;

		for(i = 1; i < n; i++)
		{
			m *= 2;
			Msum += m;
		}

		printf("%.0lf %.0lf\n", Msum, N * n);

	}
	return 0;
}

Double click to view unformatted code.


Back to problem 115