View Code of Problem 115

#include <stdio.h>
int main()
{
	int i;
	int a;

	while(scanf("%d",&a)!=EOF)
	{
			int sum = 1;
 	    int b = 100000;
	   int t = 1;
		if(a==1)
		printf("%d %d\n",sum,b);
		else{ 
		for(i = 1;i<a;i++)
		{
		  t = t*2;
		  sum = t + sum;
		  b = b+100000;	
		}
		printf("%d %d\n",sum,b);
		} 
	}	
	return 0;
}

Double click to view unformatted code.


Back to problem 115