View Code of Problem 115

#include<iostream>

using namespace std;

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

Double click to view unformatted code.


Back to problem 115