摘要: ``` include using namespace std; class retangle{ public: retangle(double x,double y); double area(); private: double length,width; }; retangle::retang 阅读全文
posted @ 2018-04-07 11:40 雪卿狂 阅读(221) 评论(7) 推荐(0) 编辑
摘要: 构造函数和析构函数 一、构造函数: 类名(形参表) 1、普通构造函数:在对象被创建时利用特定的值构造对象,将对象初始化到一个特定的状态。 特性:构造函数的函数名和类名相同;没有返回值;在对象被创建时被自动调用;如果有构造函数,建立对象时必须给出初始值。 2、复制构造函数(特殊的构造函数)(类名(类名 阅读全文
posted @ 2018-04-01 19:42 雪卿狂 阅读(586) 评论(1) 推荐(0) 编辑
摘要: 具体思路就是把一个位数很多的整数当成一个字符串来看待吧,相加的时候通过数组把它再化为整数并且让他们的个位对齐 如果有简便算法请指教 阅读全文
posted @ 2018-04-01 16:40 雪卿狂 阅读(196) 评论(0) 推荐(0) 编辑
摘要: ![](https://images2018.cnblogs.com/blog/1348769/201804/1348769-20180401102712425-1222053742.png) ![](https://images2018.cnblogs.com/blog/1348769/201804/1348769-20180401102832521-318621153.png) ![](ht... 阅读全文
posted @ 2018-03-25 08:50 雪卿狂 阅读(255) 评论(11) 推荐(0) 编辑
摘要: 函数: 函数的定义与使用: 函数的参数传递:1.值传递 2.引用传递 内联函数: inline 类型说明符 函数名(含类型说明的形参表) { 语句序列 } 带默认形参值的函数: 函数在定义时可预先声明默认的形参值 有默认值的形参必须在形参列表的最后 在形同的作用域内,不允许在 同一个函数的多个声明中 阅读全文
posted @ 2018-03-24 18:20 雪卿狂 阅读(168) 评论(0) 推荐(0) 编辑
摘要: ![](https://images2018.cnblogs.com/blog/1348769/201804/1348769-20180401205729857-1803524623.png) 阅读全文
posted @ 2018-03-24 17:49 雪卿狂 阅读(234) 评论(0) 推荐(0) 编辑
摘要: include include using namespace std; //掷骰子,计算和数,输出和数 int rollDice() { int die1=1+rand()%6; int die2=1+rand()%6; int sum=die1+die2; cout seed;//输入随机数种子 阅读全文
posted @ 2018-03-24 17:48 雪卿狂 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-03-17 00:13 雪卿狂 阅读(128) 评论(1) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-03-14 16:46 雪卿狂 阅读(172) 评论(4) 推荐(0) 编辑