#include<bits/stdc++.h> using namespace std; #define max 100000 int main(){ //fu 陌生人给的钱 qio 富翁给的钱 long long fu ,qio ,j = 2; double op ; int n; while(scanf("%d",&n)!=EOF){ op = 1,fu = 0,qio = 0; for(int i = 1;i<=n;i++){ op = pow(2,i-1); fu = fu + max; qio = qio + op; } cout<<qio<<" "<<fu<<endl; } return 0; } |
Double click to view unformatted code.