竞赛
考级
#include<bits/stdc++.h> using namespace std; int f(int a,int b){ if(b==0){ return a; } return f(b,a%b); } int main(){ long long n,m; cin>>n>>m; cout<<n*m/f(n,m); return 0; }
https://apps.fuyeor.com/zh-cn/games/#Hanoi
进制转换2
点赞!!!!!!!!!!!!!!!!! 关注也可以
进制转换1
计算阶乘
https://www.acgo.cn/application/1819320347874357248
前n项和
汉诺塔
https://www.acgo.cn/application/1819990390294495232 缺人!!!
前序遍历 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N]; int n; //输出以root为根的二叉树先序遍历 void dfs(int root){ if(root>n) return ; cout<<a[root]<<' '; dfs(root2); dfs(root2+1); } int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; dfs(1); } 中序遍历 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N]; int n; //输出以root为根的二叉树先序遍历 void dfs(int root){ if(root>n) return ; } int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; dfs(1); } 后序遍历 #include<bits/stdc++.h> using namespace std; const int N =1e5+5; int a[N]; int n; void postorder(int root){ if(root>n) return ; postorder(root2); postorder(root2+1); cout<<a[root]<<' '; } int main(){ }
最后一行不是两个数吗???????????
共24583条