Hdu2018 母牛的故事
来源:互联网 发布:下载软件管理器 编辑:程序博客网 时间:2024/05/16 06:08
#include <iostream>
#include <algorithm>
using namespace std;
int f(int x){
if(x<=4){
return x;
}
if(x>4){
return f(x-1)+f(x-3);
}
}
int main()
{
int b;
while(cin>>b&&b){
cout<<f(b)<<endl;
}
return 0;
}
#include <algorithm>
using namespace std;
int f(int x){
if(x<=4){
return x;
}
if(x>4){
return f(x-1)+f(x-3);
}
}
int main()
{
int b;
while(cin>>b&&b){
cout<<f(b)<<endl;
}
return 0;
}
阅读全文
0 0
- hdu2018母牛的故事
- hdu2018 母牛的故事
- hdu2018母牛的故事
- HDU2018 母牛的故事
- HDU2018 母牛的故事
- HDU2018 母牛的故事
- HDU2018 母牛的故事
- HDU2018--母牛的故事
- <HDU2018>母牛的故事
- HDU2018母牛的故事
- 母牛的故事hdu2018
- Hdu2018 母牛的故事
- hdu2018母牛的故事
- hdu2018母牛的故事 规律题
- hdu2018——母牛的故事
- hdu2018 母牛的故事 (动态规划)
- (解题报告)HDU2018---母牛的故事
- hdu2018 母牛的故事(模拟)
- freebuf上一篇关于waf绕过的介绍
- 多种单例模式实现方法详解——java代码
- 开篇第一章<简要IOT技术栈分析>
- RabbitMQ系列
- kaldi006 -- 构图
- Hdu2018 母牛的故事
- 如何解决wireshark抓包大于mtu的问题
- 关于网页消息提示音问题解决与实现
- C++容器vector的常用成员函数
- Linux(centos7)安装redis及第一个helloWorld
- 图的邻接表表示法及遍历
- 反射-通过反射写一个通用的设置某个对象的某个属性为指定的值
- 【Linux】I/O多路转接poll
- react---react创建组件的三种方式以及区别:无状态组件、工厂模式、es6语法定义