View Code of Problem 115

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

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

Double click to view unformatted code.


Back to problem 115