View Code of Problem 3692

#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int t;
	while (cin >> t) {
		long long sum = 3;
		if (t % 2 == 0)sum = pow(2, t) + 2;
		else if(t>1)sum = pow(2, t) - 2;
		if (!t)sum = 0;
		cout << sum << endl;
	}
}

Double click to view unformatted code.


Back to problem 3692