View Code of Problem 115

#include<iostream>

using namespace std;

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

Double click to view unformatted code.


Back to problem 115