数据结构-无向图的连通分量和生成树-题解(C++代码) ```cpp#includeusingnamespacestd;constintn=52;typedefintadjMatrix[n][n];structGraph{intvexnum;adjMatrixarcs;};structNode{intdata;structNode*lchild=NULL; 题解列表 2020年03月13日 0 点赞 0 评论 1503 浏览 评分:9.9
数据结构-静态表的顺序查找-题解(C++代码) 向前逐个查找即可。不过如果找不到记得输出-1```cpp#includeusingnamespacestd;intmain(){intk,n;cin>>n>>k;inta[n],b[k];for(inti=0;i>a[i];}for(intj=0;j>b[j];intf=0;for(inti=n-1; 题解列表 2020年03月13日 0 点赞 0 评论 1559 浏览 评分:8.0
[编程入门]Sn的公式求和-题解(C语言代码) 摘要: 代码: #include int main() { int a,b,c,d; scanf("%d",&a); int sum=2;…… 题解列表 2020年03月13日 0 点赞 0 评论 1286 浏览 评分:0.0
信息学奥赛一本通T1005-地球人口承载力估计-题解(C语言代码)【iorixq】 代码没什么难度,我们主要来看题解:1、首先,我们了解到地球资源是恒定增长的,也即随着年度而增加,假设增长率为p每年;2、已知110亿人口可生活90年,那么消耗的总资源为110X90=990090亿人口可生活210年,消耗的总资源为90X210=189003、资源差为18900-9900=9000, 题解列表 2020年03月13日 1 点赞 0 评论 1422 浏览 评分:0.0
数据结构-采用十字链表存储的稀疏矩阵-题解(C++代码) ```cpp#includeusingnamespacestd;structA{introw;intcol;intdata;structA*pi=NULL;structA*pj=NULL;};typedefA*PA;voiddisp(PArhead[], 题解列表 2020年03月13日 0 点赞 1 评论 1334 浏览 评分:4.7
[编程入门]阶乘求和-题解(C语言代码) 摘要: 代码的原理可以看数学题,这个很无语但也没办法。这里有一些细节就是数量限制,不能超过20,然后是每个数值的结果相加。但是最重要的是类型,‘不是整型而是长整型’这个一定要记住。出题人把坑挖的挺深。这个…… 题解列表 2020年03月13日 0 点赞 0 评论 1435 浏览 评分:0.0
C语言训练-最大数问题-题解(C++代码) ```cpp#includeusingnamespacestd;typedefstructNode{intdata;structNode*next;};voidcreate_list(Node*&p){Node*l=p,*s;l->next=NULL;//头结点//碰到-1退出intn;cin>>n; 题解列表 2020年03月13日 0 点赞 1 评论 1252 浏览 评分:9.9
C语言训练-字符串正反连接-题解(C++代码) 摘要:```cpp #include #include using namespace std; int main() { string s1,s2; cin>>s1;…… 题解列表 2020年03月13日 0 点赞 0 评论 1117 浏览 评分:0.0
蓝桥杯算法训练VIP-一元三次方程求解-题解(Python代码) ###python二分查找```pythona,b,c,d=map(float,input().split())deff(x):returna*x**3+b*x**2+c*x+dforiinrange(-100,100):l,r=i,i+1flag=1whiler-l>10e-5:mid=(l+r)/ 题解列表 2020年03月13日 0 点赞 1 评论 1924 浏览 评分:9.9
数据结构-线索二叉树-题解(C++代码) ```cpp#includeusingnamespacestd;structA{chardata;structA*lchild;structA*rchild;intltag=0,rtag=0;};typedefA*PA;voidInThreading(PA&p, 题解列表 2020年03月13日 0 点赞 0 评论 1194 浏览 评分:9.9