[递归]母牛的故事 C语言做法 解题思路:经过对题目的研究,不难发现前四年是遵循1234的规律递增,当到了第五年开始,递增规律发生改变,第五年是在第四年的基础上,因为产下的第二头母牛可以产小牛,所以是4+2=6,用数组表示就是V[n]=V[n-1]+V[n-3](n为当前年份)。 题解列表 2022年09月23日 0 点赞 0 评论 701 浏览 评分:9.9
c语言,用指针 摘要:#include<stdio.h> void change(int*q, int*p); int main() { int c = 0, b = 9; int* max = &c, * …… 题解列表 2022年09月23日 0 点赞 0 评论 586 浏览 评分:0.0
绝对值排序 摘要:解题思路:冒泡排序注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){ int n; whi…… 题解列表 2022年09月23日 0 点赞 0 评论 429 浏览 评分:7.0
递归复原二叉树,后序遍历输出 摘要:参考代码:import java.util.*; public class Main { static char[] preorder; static char[] inor…… 题解列表 2022年09月23日 0 点赞 0 评论 755 浏览 评分:0.0
自定义函数之数字分离 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[4],n,i; scanf("%d",&n); i=0; while(n>0)…… 题解列表 2022年09月22日 0 点赞 0 评论 518 浏览 评分:0.0
二维数组的转置 : 行列调换 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[3][3],i,j; for(i=0;i<3;i++) { for(…… 题解列表 2022年09月22日 0 点赞 0 评论 484 浏览 评分:0.0
自定义函数处理素数+运用逻辑判断 摘要:解题思路:注意事项:参考代码:#include<stdio.h>void isPrime(int n);int main(){ int n; scanf("%d",&n); isPr…… 题解列表 2022年09月22日 0 点赞 0 评论 518 浏览 评分:0.0
1134: C语言训练-求PI* ```cpp#include#include#includeusingnamespacestd;intmain(){doublePI=0,denominator=1;inti=0;while(1/denominator>=1e-6){PI+=(pow(-1, 题解列表 2022年09月22日 0 点赞 0 评论 647 浏览 评分:9.9
1133: C语言训练-求1+2!+3!+...+N!的和 摘要:```cpp #include using namespace std; long long a[21],n,t=1; int main() { cin>>n; a[1]…… 题解列表 2022年09月22日 0 点赞 0 评论 558 浏览 评分:9.9
1132: C语言训练-最大数问题 ```cpp#includeusingnamespacestd;intmain(){intx,maxx;boolflag=true;do{cin>>x;if((flag||x>maxx)&&x!=-1){maxx=x;flag=false;}}while(x!=-1);if(flag)cout 题解列表 2022年09月22日 0 点赞 0 评论 837 浏览 评分:9.9