2017年3月31日
该文被密码保护。 阅读全文
posted @ 2017-03-31 19:19 TogetherLaugh 阅读(5) 评论(0) 推荐(0) 编辑
  2017年3月29日
摘要: Description 数组和链表是我们熟知的两种线性结构,但是它们不够灵活(不能同时实现直接插入、删除和访问操作),给你若干种操作,你能通过一种灵活的容器,实现它们的功能吗? 操作1:Build a b (产生一个大小为a的线性表,其值全部赋为b,每组样例仅出现一次,在起始行) 操作2:Modif 阅读全文
posted @ 2017-03-29 19:35 TogetherLaugh 阅读(612) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<vector>#include<algorithm>using namespace std;int main(){ vector <string> names; names.push_back("WXH"); na 阅读全文
posted @ 2017-03-29 18:24 TogetherLaugh 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<vector>using namespace std;int main(){ vector <string> names; names.push_back("xiao jia yu ~"); names.push_ 阅读全文
posted @ 2017-03-29 18:05 TogetherLaugh 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<vector>using namespace std;int main(){ vector <string> name; name.push_back("xiao jia yu ~"); name.push_bac 阅读全文
posted @ 2017-03-29 17:59 TogetherLaugh 阅读(102) 评论(0) 推荐(0) 编辑
  2017年3月28日
摘要: return 比较式即可 重载了就可以用了 【】需要引用 模板这样的必须有<> 不可以用+= 私有直接不可访问 阅读全文
posted @ 2017-03-28 18:26 TogetherLaugh 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Description 封装一个模板数组类,用于存储数组和处理的相关功能,支持以下操作: 1. Array::Array(int l)构造方法:创建一个长度为l的组对象。 2. Array::size()方法:返回Array对象中元素个数。 3. Array::put(int n)方法:按从大到小的 阅读全文
posted @ 2017-03-28 18:23 TogetherLaugh 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Description 定义一个类模板Data,用于包装C++中的基本数据类型int和double。它包括: 1. 数据成员value为该对象所包装的值。 2. 无参构造函数(初始化value为0)和带参构造函数。 3. 重载的运算符:>、<、+以及<<。其中"+"返回和,不改变两个操作数的值。 4 阅读全文
posted @ 2017-03-28 18:23 TogetherLaugh 阅读(1277) 评论(0) 推荐(0) 编辑
  2017年3月26日
摘要: #include<iostream>using namespace std;//如果不会,不妨由会开始//1~FIRST://int mmax(int a,int b)//{// return a>b?a:b;//}//2~SECOND:// T mmax(T a,T b)//{// return 阅读全文
posted @ 2017-03-26 18:07 TogetherLaugh 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Description 定义一个字符类Character,只有一个char类型的数据成员。 重载它的+、-、<<和>>运算符,其中+、-的第二个操作数是int类型的整数n。“+”用于返回以当前字符之后的第n个字符为属性值的对象,“-”用于返回当前字符之前的第n个字符为属性值的对象。如样例所示。 定义 阅读全文
posted @ 2017-03-26 18:01 TogetherLaugh 阅读(1200) 评论(0) 推荐(0) 编辑