标签:
描述:
1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { 6 static int a[55]; 7 a[1] = 1;a[2] = 2;a[3] = 3;a[4] = 4; 8 for (int i = 5;i < 55;i++) 9 a[i] = a[i - 1] + a[i - 3]; 10 int s; 11 while ((cin >> s) && (s != 0)) 12 cout << a[s] << endl; 13 system("pause"); 14 return 0; 15 }
标签:
原文地址:http://www.cnblogs.com/wuyoucao/p/4814948.html