2018 母牛的故事 题解

由题意得: 1.此题是递归类型 2.此题也是数学中的函数问题 3.函数为:f(x)=x(x<5)&&f(x)=f(x-1)+f(x-3)(x>=5) 4.代码如下: #include<stdio.h> #include<stdlib.h>int cow(int n) {     if(n<5)         return n;     else         return cow(n-1)+c
相关文章
相关标签/搜索