Sweety

Practice makes perfect

导航

2014年7月23日

摘要: B - This Sentence is False (6.3.2)(6.3相关题库) #include #include #include #include #include using namespace std; #define maxn ... 阅读全文

posted @ 2014-07-23 17:56 蓝空 阅读(128) 评论(0) 推荐(0) 编辑

摘要: 如何用随机数生成0到n之间的m个不重复的数 1、最直接的方法就是先随机生成一个0到n之间的数,判断这个数是否已被选上,如果以前没选过,则选上,如果以前已选,则丢弃 [cpp] view plaincopyprint? void common(int n,int m) { ... 阅读全文

posted @ 2014-07-23 17:54 蓝空 阅读(197) 评论(0) 推荐(0) 编辑

摘要: 1、首先必须了解,string可以被看成是以字符为元素的一种容器。字符构成序列(字符串)。有时候在字符序列中进行遍历,标准的string类提供了STL容器接口。具有一些成员函数比如begin()、end(),迭代器可以根据他们进行定位。 注意,与char*不同的是,string不一定以NULL... 阅读全文

posted @ 2014-07-23 17:18 蓝空 阅读(239) 评论(0) 推荐(0) 编辑

摘要: Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by ... 阅读全文

posted @ 2014-07-23 15:18 蓝空 阅读(152) 评论(0) 推荐(0) 编辑

2014年7月22日

摘要: 你是否已经对每次从Map中取得关键字然后再取得相应的值感觉厌倦?使用Map.Entry类,你可以得到在同一时间得到所有的信息。标准的Map访问方法如下: Set keys = map.keySet( ); if(keys != null) { Iterator iterator = k... 阅读全文

posted @ 2014-07-22 17:56 蓝空 阅读(2485) 评论(0) 推荐(0) 编辑

摘要: 原作 http://blog.csdn.net/shawn_hou/article/details/38035577 Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据 处理能力,由于这个特性,它... 阅读全文

posted @ 2014-07-22 17:52 蓝空 阅读(241) 评论(0) 推荐(0) 编辑

摘要: Description Hardwoods are the botanical group of trees that have broad leaves, produce a fruit or nut, and generally go dormant in the winter.... 阅读全文

posted @ 2014-07-22 17:00 蓝空 阅读(140) 评论(0) 推荐(0) 编辑

摘要: Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunatel... 阅读全文

posted @ 2014-07-22 14:20 蓝空 阅读(184) 评论(0) 推荐(0) 编辑

摘要: (1)归并排序(经典) (2)冒泡法 (3)快速排序 (4)插入排序 (5)希尔(shell)排序 (6)选择排序 (7)堆排序 附: 排序算法原理:http://zh.wikipedia.org/wiki/Category:%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3... 阅读全文

posted @ 2014-07-22 10:04 蓝空 阅读(152) 评论(0) 推荐(0) 编辑

2014年7月21日

摘要: sscanf函数用法详解 首先应该注意的是 sscanf()只能对字符数组进行操作,但是不能对string字符串操作 名称: sscanf() - 从一个字符串中读进与指定格式相符的数据. 函数原型: Int sscanf( string str, string f... 阅读全文

posted @ 2014-07-21 19:48 蓝空 阅读(4810) 评论(0) 推荐(0) 编辑