会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Dreamlife23333
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
下一页
2018年5月2日
二叉树
摘要: 实现二叉树的基本操作:建立、遍历、计算深度、结点数、叶子数等。输入C,先序创建二叉树,#表示空节点;输入H:计算二叉树的高度;输入L:计算二叉树的叶子个数;输入N:计算二叉树节点总个数;输入1:先序遍历二叉树;输入2:中序遍历二叉树;输入3:后续遍历二叉树;输入F:查...
阅读全文
posted @ 2018-05-02 09:42 UnderScrutiny
阅读(207)
评论(1)
推荐(1)
2018年4月30日
return与析构续
摘要: #include using namespace std;class Point{private: int x,y;public: Point(int a,int b=0){ x=a;y=b; cout<<"normal"<<e...
阅读全文
posted @ 2018-04-30 17:42 UnderScrutiny
阅读(170)
评论(0)
推荐(0)
return与析构函数
摘要: #include using namespace std;class a{private: int i;public: a(int n):i(n){ cout<<"constructing"<<endl; } ~a(){ ...
阅读全文
posted @ 2018-04-30 17:31 UnderScrutiny
阅读(335)
评论(0)
推荐(0)
拷贝构造函数
摘要: #include using namespace std;class Point{private: int x,y;public: Point(int a,int b=0){ x=a;y=b; cout<<"normal"<<e...
阅读全文
posted @ 2018-04-30 09:07 UnderScrutiny
阅读(109)
评论(0)
推荐(0)
2018年4月28日
引用
摘要: #include using namespace std;int &f(int &i){ i=i+10; return i;}int main(){ int k=0; int &m=f(k); cout<<k<<endl; m=20...
阅读全文
posted @ 2018-04-28 23:03 UnderScrutiny
阅读(91)
评论(0)
推荐(0)
返回引用的函数值和参数的引用
摘要: #include using namespace std;int &max1(int &num1,int &num2){ return (num1>num2)?num1:num2;}int &min1(int &num1,int &num2){ retur...
阅读全文
posted @ 2018-04-28 22:16 UnderScrutiny
阅读(209)
评论(0)
推荐(0)
使用引用返回函数值
摘要: #include using namespace std;int a[]={1,3,5,7,9};int &index(int i){ return a[2];}int main(){ cout<<index(2)<<endl; cout<<a[2]...
阅读全文
posted @ 2018-04-28 21:08 UnderScrutiny
阅读(269)
评论(0)
推荐(0)
2018年4月27日
邻接表--图 部分代码
摘要: h文件#pragma once#include using namespace std;typedef int E;typedef char T;const int defaultVertices = 30;struct Edge { int dest; E cost...
阅读全文
posted @ 2018-04-27 17:00 UnderScrutiny
阅读(244)
评论(0)
推荐(0)
2018年4月26日
dec,hex and oct
摘要: #include using namespace std;int main(){ int x=25; cout<<hex<<x<<' '<<dec<<x<<' '<<oct<<x<<'\n'; return 0;}
阅读全文
posted @ 2018-04-26 20:51 UnderScrutiny
阅读(244)
评论(0)
推荐(0)
2018年4月25日
将有字母A组成的三角形写入文件,然后读出
摘要: #include #include #include using namespace std;int main(){ ofstream fout("test.txt",ios::out); if(!fout){ cout#include us...
阅读全文
posted @ 2018-04-25 21:46 UnderScrutiny
阅读(151)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告