View Code of Problem 115

#include<stdio.h>
#include <string.h>
#include <math.h>
int main(){
	int n;
	int a,b,c;
	while(scanf("%d",&n)!=EOF){
		if(n>30)
		break;
		int i,j;
		a=0;
		b=0;
		c=1;
		for(i=1;i<=n;i++){
			b +=100000;
			a +=c;
			c *=2;
		}
		printf("%d %d",a,b);
	}
	printf("\n");
	return 0;
}

Double click to view unformatted code.


Back to problem 115