View Code of Problem 115

#include <iostream>
using namespace std;

int main() {
	int n;
	while(cin >>n){
		int sum1=0,sum2=0;
		int k1=100000,k2=1;
		for(int i=0;i<n;i++){
			sum1+=k1;
			sum2+=k2;
			k2=k2*2;
		}
		cout << sum2 <<" "<<sum1<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 115