随笔分类 -  C++知识

priority_queue的用法
摘要:#include#includeusing namespace std;typedef long long LL;typedef pair P;struct node{ int x,y; node(){} node(int cx,int cy):x(cx),y(cy){} f... 阅读全文

posted @ 2015-11-01 11:35 vCoders 阅读(487) 评论(0) 推荐(0)

C语言中clock函数的使用
摘要:#include#include#includeusing namespace std;int main(){ int i=100000000; clock_t start,finish; double duration; start=clock();//开始计时刻 ... 阅读全文

posted @ 2015-11-01 09:37 vCoders 阅读(1447) 评论(0) 推荐(0)

C++输入输出知识
摘要:1.strtok将字符串中的单词用' '分割出来#include#include#include#include#includeusing namespace std;int main(){ /* fstream fin("input.txt",ios::in); fin>>va... 阅读全文

posted @ 2015-09-04 18:08 vCoders 阅读(289) 评论(0) 推荐(0)

C++STL 库中set容器应用
摘要:#include#include#includeusing namespace std;set a;int main(){ //插入元素 a.insert(1); a.insert(3); a.insert(5); //用迭代器遍历容器; set::itera... 阅读全文

posted @ 2015-08-30 16:04 vCoders 阅读(258) 评论(0) 推荐(0)

C++STL库中vector容器常用应用
摘要:#include#include#include using namespace std;int main(){ vector vec; vec.push_back(1);//在尾部插入元素 vec.push_back(2);// cout::iterator it; ... 阅读全文

posted @ 2015-08-30 13:06 vCoders 阅读(248) 评论(0) 推荐(0)

C++STL库中map容器常用应用
摘要:#include#include#include //按键值大小构成二叉搜索树 using namespace std;map a;int main(){ a.insert(map::value_type(1,"li")); a.insert(map::value_type(1,"LI"... 阅读全文

posted @ 2015-08-30 13:01 vCoders 阅读(209) 评论(0) 推荐(0)

导航