上一页 1 ··· 14 15 16 17 18
  2016年10月16日
摘要: /*Are they equal*/#include<iostream>#include<string>using namespace std;int n;string deal(string s, int & e){ int k = 0; while(s.length() > 0 && s[0] 阅读全文
posted @ 2016-10-16 16:28 Google-boy 阅读(255) 评论(0) 推荐(0)
摘要: /*C 语言中字符数组一般会采用char str[]来存放,但是显得会比较麻烦,C++在stl中加入了string类型,对字符串常用的功能进行了封装,操作起来比较方便*/ 输出结果如下: hello world 通过迭代器进行访问 /*string的拼接*/ 输出结果:: hello world h 阅读全文
posted @ 2016-10-16 12:24 Google-boy 阅读(187) 评论(0) 推荐(0)
摘要: /*set意为集合,是一个内部自动排序不含重复元素的容器*/ 输出结果如下: 235 阅读全文
posted @ 2016-10-16 11:50 Google-boy 阅读(237) 评论(0) 推荐(0)
  2016年10月15日
摘要: vector直译有“容器”之意,我们可以把它理解成是一个不限长度的数组。 我们可以通过代码进一步理解vector。 示例代码如下: 输出结果如下: 12345 /*vector的常见用途: 存储数据; 用邻接表存储图*/ 输出结果如下: 012 0812 0 关于vector更详细的介绍:http: 阅读全文
posted @ 2016-10-15 10:59 Google-boy 阅读(178) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18