摘要: //11-7 #include using namespace std; int main(){ ios_base::fmtflags original_flags=cout.flags();//保存现有的格式化参数设置 cout #include using namespace std; int main() { ofstream out("test1.txt");... 阅读全文
posted @ 2018-06-20 22:50 *烟雨行舟* 阅读(133) 评论(0) 推荐(0)
摘要: //6-1#include using namespace std; class A{ public: A(int a,int b):m(a),n(b){} int add(){ cout using namespace std; class vehicle{ public: vehicle(int m,i... 阅读全文
posted @ 2018-06-07 20:43 *烟雨行舟* 阅读(375) 评论(0) 推荐(0)
摘要: //6-17 改: #include using namespace std; int main(){ int a,*p=&a; *p=9; cout using namespace std; int fn1(){ int *p=new int (5); return *p; delete p; } int main(){ int a=... 阅读全文
posted @ 2018-05-23 22:47 *烟雨行舟* 阅读(113) 评论(0) 推荐(0)
摘要: 文件1,类的定义,Complex.h class Complex { public:// Complex(float r1,float i1); Complex(float a1); void add(Complex c2); void show(); private: float r,i; }; //文件2,类的实现,Complex.cpp #i... 阅读全文
posted @ 2018-04-23 23:41 *烟雨行舟* 阅读(104) 评论(0) 推荐(0)
摘要: 总结:1.构造函数的作用就是在对象被创建时利用特定的值构造对象,将对象初始化为一个特定的状态。 2.构造函数在对象被创建的时候将被自动调用。 3.对象的名字下要加下划线。 阅读全文
posted @ 2018-04-08 23:08 *烟雨行舟* 阅读(88) 评论(2) 推荐(0)
摘要: 总结:本次实验我发现我的算法存在很多不足之处,有些是在舍友帮助的情况下完成的,编程过程中也有些细节之处存在不足,在接下来的时间里,当好好复习算法、语句等。 阅读全文
posted @ 2018-03-25 10:37 *烟雨行舟* 阅读(75) 评论(1) 推荐(0)
摘要: 实验总结:本次实验让原本不熟悉c++的人渐渐地掌握一点基本的知识,之前学习c语言的时候动手操作能力实在是太差,现在看来当时的学习状态是真的差,本学期要学好c++,最重要的是多实践。 阅读全文
posted @ 2018-03-17 18:51 *烟雨行舟* 阅读(86) 评论(1) 推荐(0)