![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
程序运行
文章平均质量分 62
leiwenyu_Zoe
这个作者很懒,什么都没留下…
展开
-
实验七
实验目的和要求 熟悉运算符重载的定义和使用方法 实验内容 1.调试下列程序 include using namespace std; class complex { public: complex(){real=imag=0.0;} complex(double r){real=r;imag=0.0;} complex(...原创 2018-06-12 17:23:23 · 125 阅读 · 0 评论 -
实验八
实验目的和要求 1.能够使用C++模板机制定义重载函数。 2.能够实例化及使用模板函数。 3.能够实例化和使用模板类。 4.应用标准C++模板库(STL)通用算法和函数对象实现查找和排序。 实验内容 1.分析并调试下列程序,了解函数模板的使用。 //sy8_1.cpp include using namespace std; template T max(T a,T...原创 2018-06-12 17:29:47 · 169 阅读 · 0 评论 -
实验九
实验目的和要求 1.掌握格式化的输入输出方法。 2.熟悉系统提供的输入操作函数。 3.掌握磁盘文件的输入输出方法。 实验内容 1.程序sy9_1.cpp用以打印表中的数据,但程序中存在逻辑错误。上机调试后写出正确的代码 //sy9_1.cpp include include using namespace std; int main() { int n[...原创 2018-06-12 17:33:51 · 171 阅读 · 0 评论 -
实验十
实验目的和要求 1.正确理解C++的异常处理机制。 2.学习异常处理的声明和执行过程。 实验内容 1.下面是一个文件打不开的异常处理程序,分析程序并完成相应问题。 //sy10_1.cpp include include include using namespace std; int main() { ifstream source(“myfile...原创 2018-06-21 12:39:06 · 150 阅读 · 0 评论 -
实验五
1.调试下列程序,并在对程序进行修改后再调试,支出调试中的错误原因 include using namespace std; class A { public: void seta(int i){a=i;} int geta(){return a;} public: int a; }; class B:public A { p...原创 2018-05-31 14:36:26 · 234 阅读 · 0 评论 -
实验六
1.分析并调试下列程序。 include using namespace std; class Base { public: virtual void f(float x){cout<<”Base::f(float)”< include using namespace std; class Base { public: ...原创 2018-05-31 14:43:00 · 134 阅读 · 0 评论