标签:教学 put pac strong 四川 iostream problem 课堂 std
#include <iostream> using namespace std; int main(void) { int n, t; while(cin >> t) { while(t--) { cin >> n; int p = 1, q = 3; for(int i = 2; i < n; i++) { int y = q; q = p * 2 + q; p = y; } if(n == 1) cout << p << endl; else if(n == 2) cout << q << endl; else cout << q << endl; } } return 0; }
HDU-2190 悼念512汶川大地震遇难同胞——重建希望小学
标签:教学 put pac strong 四川 iostream problem 课堂 std
原文地址:http://www.cnblogs.com/limyel/p/7159945.html