标签:nbsp while -- name using names code pre iostream
#include <iostream> using namespace std; int main() { int n,a; while (cin >> n) { while (n--) { cin >> a; long num = pow(2, a) + 2; cout << num << endl; } } }
a(n) = 2*a(n-1) -2
a(n) -2 = 2*{a(n-1) -2}
a(n) = 2^n + 2
标签:nbsp while -- name using names code pre iostream
原文地址:http://www.cnblogs.com/theskulls/p/6005819.html