解题思路:
注意事项:
参考代码:
#include <iostream>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <string>
#include <cmath>
#include <cstdlib>
#include <string.h>
using namespace std;
int f(int n)
{
if(n==1)
{
return 1;
}
if(n==2)
{
return 1;
}
if(n==3)
{
return 1;
}
return f(n-1)+f(n-3);
}
int main()
{
int n;
cin>>n;
cout<<f(n)<<endl;
return 0;
}
0.0分
11 人评分
字符串输入输出函数 (C++代码)(都当成字符串吧hhhhhhhh)浏览:493 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:439 |
A+B for Input-Output Practice (C++代码)浏览:609 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:635 |
C语言训练-阶乘和数* (C语言代码)-------- 呆板写法浏览:1360 |
printf基础练习2 (C语言代码)浏览:646 |
愚蠢的摄影师 (C++代码)浏览:938 |
数字游戏 (C++代码)浏览:1184 |
剪刀石头布 (C++代码)浏览:1711 |
C语言程序设计教程(第三版)课后习题12.6 (C语言代码)浏览:661 |