descroption:
一排座位,至少要做一个人,两个人之间 至少 留下两个空位,问 如果有n 个座位的时候,有多少种做法;
#include<bits/stdc++.h>
using namespace std;
int fun(int n)
{
if(n==1) return 1;
else
if(n==2) return 2;
else if(n==3)
return 3;
else
return fun(n-1)+fun(n-3)+1;
}
int main()
{
int n;
while(cin>>n)
cout<<fun(n)<<endl;
}
#endif
573



被折叠的 条评论
为什么被折叠?



