摘要: #include<bits/stdc++.h> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> using namespace std; //a、b、c、d是 阅读全文
posted @ 2020-09-26 23:14 Akmf's_blog 阅读(209) 评论(4) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> using namespace std; typedef in 阅读全文
posted @ 2020-09-24 18:26 Akmf's_blog 阅读(72) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> using namespace std; //1.让输入10个 阅读全文
posted @ 2020-09-24 17:57 Akmf's_blog 阅读(71) 评论(0) 推荐(0) 编辑
摘要: //leetcode700 二叉搜索树中的搜索 TreeNode* searchBST(TreeNode* root, int val) { if(root == nullptr || root->val == val) return root; if(root->val > val) return 阅读全文
posted @ 2020-09-22 17:31 Akmf's_blog 阅读(121) 评论(0) 推荐(0) 编辑
摘要: //1.计算度为2 度为1 度为0的结点个数 void Count(BiTree bt) { if(bt) { if(bt->lchild && bt->rchild) n2++; else if(bt->lchild && !bt->rchild || bt->rchild && !bt->lch 阅读全文
posted @ 2020-09-19 21:30 Akmf's_blog 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> #include<cmath> using namespace 阅读全文
posted @ 2020-09-19 20:22 Akmf's_blog 阅读(103) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> //求n个数的最小公倍数 #define lcm(a,b) a / gcd(a,b)*b long gcd(long m,long n) { while(n) { long tmp = m % n; m = n; n = tmp; } return m 阅读全文
posted @ 2020-09-15 21:33 Akmf's_blog 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> //发工资 其实就是在数组中求面值数 int main1() { int n ; int a[] = {100,50,10,5,2,1}; int size =sizeof(a) /sizeof(int); int res; int val; whil 阅读全文
posted @ 2020-09-14 20:09 Akmf's_blog 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<bits/stdc++.h> //去掉一个最高分和一个最低分,然后计算平均得分 int main1() { int n; int a[101]; int sum; while(scanf("%d",&n)!=EOF) { sum = 0; for 阅读全文
posted @ 2020-09-13 20:20 Akmf's_blog 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> //统计给定的n个数中,负数、零和正数的个数。 int main1() { int n; while(scanf("%d",&n)!=EOF) { if(n == 0) break; int fu = 0,zero = 0 ,zh 阅读全文
posted @ 2020-09-11 20:53 Akmf's_blog 阅读(144) 评论(0) 推荐(0) 编辑