View Code of Problem 115

#include <bits/stdc++.h>
using namespace std;
#define money 100000

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

Double click to view unformatted code.


Back to problem 115