- 博客(11)
- 收藏
- 关注
原创 蓝桥杯:后缀表达式
#include<iostream>#include<cmath>#include<algorithm>using namespace std; int main(){ int N,M,i,j,pos=0,neg=0; cin>>N>>M; int ans=N+M+1; long long sum=0,sum1=0,a[ans]; for(i=0;i<ans;i++){ cin>>a[i];
2022-01-26 22:51:47 648
原创 蓝桥杯题目:等差数列
#include<iostream>#include<math.h>#include<iomanip>#include<algorithm>using namespace std;int b[100002]={0},a[100002]={0};//首先写一个实现求最大公约数的函数,这里用的是辗转相除法int zhanzhuan(int a, int b){ if(a%b==0) return b; else zhanzhuan(b,a%b)
2022-01-24 21:50:09 306
原创 图的邻接矩阵
//6 10//1 2 3 4 5 6//0 1 6//0 2 1//0 3 5//1 2 5 //1 4 3//2 3 5//2 4 6//2 5 4//3 5 2//4 5 6#include<stdio.h> #define MVNum 100 //图的最大顶点数#define MAXint 32767 //用有符号的int最大值表示无穷大typedef char vertextype; //定义定点的存储信息为字符型typedef int arc
2021-11-26 09:27:06 622
原创 数据结构二叉树递归遍历
#include<stdio.h>#include<stdlib.h>//FCA##DB###EH##GM###typedef struct BiTNode{ char data; struct BiTNode *lchild; struct BiTNode *rchild;}BiNode,* BiTree;BiTree CreateBiTree(){ BiTree T; char c; scanf("%c",&c...
2021-11-25 18:57:29 72
原创 阶乘求e值
#include<iostream>using namespace std;long long s(int c){ long long p,s=1; for(p=1;p<=c;p++) s=s*p; return s;}int main(){ int n,q; double m=1.0000000; scanf("%d",&n); for(q=1;q<=n;q++) { m=1.0/s(q)+m; } printf("%.10lf"
2021-11-23 18:51:35 1334
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人