标签:using title 提示 string 结束 miss div namespace str
5 2 -1
571, 209 11, 4 提示 可以使用long long int对付GNU C++,使用__int64对付VC6
#include <iostream> #include <string> #include <vector> using namespace std; #define limit 34 void f(long long x, long long &a, long long &b) { a += 3 * x; b += x; } void g(long long x, long long &a, long long &b) { a += 2 * x; b += x; } long long a[limit]; long long b[limit]; int main() { int n; a[0] = 1; b[0] = 0; for (int i = 1; i < limit; i++) { f(a[i - 1], a[i], b[i]); g(b[i-1], a[i], b[i]); } while (true) { cin >> n; if (n == -1) break; cout << a[n] <<", "<<b[n]<< endl; } return 0; }
标签:using title 提示 string 结束 miss div namespace str
原文地址:http://www.cnblogs.com/theskulls/p/6192911.html