标签:info names main 找规律 problem ++ name alt img
打表,找规律,
#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int f[N] = {0,1,2,3},k = 3;
int main() {
int n;
while(cin >> n && n) {
if(n > k){
while(k <= n) {
k ++;
f[k] = f[k - 1] + f[k - 3];
}
}
cout << f[n] << endl;
}
return 0;
}
标签:info names main 找规律 problem ++ name alt img
原文地址:https://www.cnblogs.com/lukelmouse/p/12302018.html