码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
c++11 thread
我看我们项目创建线程从来不join,detach#include #include #include #include void fun(){ while (true) { std::cout << "hehhe" << std::endl; }}int main()...
分类:编程语言   时间:2014-07-10 13:57:33    阅读次数:306
C++类组合问题
#include using namespace std;class Vehicle{public: Vehicle(float speed=0,int total=0) { Vehicle::speed = speed; Vehicle::total = t...
分类:编程语言   时间:2014-07-10 13:49:43    阅读次数:181
最近看了点C++,分享一下我的进度吧!
1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 //Student类 8 class Student 9 { 10 private://私有 11 char name[1...
分类:编程语言   时间:2014-07-10 13:22:54    阅读次数:276
snprintf 返回值
在平时写代码的过程中,我一个推荐带有n系列的字符串函数,如strcat ->strncatsprintf->snprintf我们有类似的一个函数void dump_kid(std::string* str, uint32_t kid){ char buffer[16]; int len; ...
分类:其他好文   时间:2014-07-10 11:27:58    阅读次数:279
最短路入门题
http://acm.hdu.edu.cn/showproblem.php?pid=2544DJ#include #include #include #include #include #define N 1000001using namespace std;int map[101][101];in...
分类:其他好文   时间:2014-06-29 18:27:50    阅读次数:285
PAT(B) 101-111-1-2014-03-01
1.个位数统计: #include #include #include #include #include #include #include #include #include #include #include using namespace std; char s[1005]; int n, a[10]; int main(){ while(gets(s)) { memset(a,...
分类:其他好文   时间:2014-06-28 08:55:24    阅读次数:191
PKU 2774 Long Long Message (后缀数组练习模板题)
题意:给你两个字符串,求最长公共字串的长度。 by:罗穗骞模板 #include #include #include #include using namespace std; #define M 303 #define inf 0x3fffffff #define maxn 500000 #define ws ww #define rank RANK #define F(x)...
分类:其他好文   时间:2014-06-28 08:00:24    阅读次数:190
Effective C++:条款33:避免遮掩继承而来的名称
(一) 下面这段代码: int x; void someFunc() { double x; //local variable std::cin>>x; //read a new value to local x } 这个指涉的是local变量x,而不是global变量x,因为内存作用域会的名称遮掩外围作用域的名称。当编译器处于someFunc的作用域内并遭遇...
分类:编程语言   时间:2014-06-28 07:58:25    阅读次数:281
poj 3678 2-sat
2-sat经典建图,注意AND为1的时候,a=0要和a=1连边,b同理,因为此时a,b都不能为0。 OR为0时候,a=1要和a=0连边,b同理,因为此时a,b都不能为1。 #include #include #include #include #include #include using namespace std; #define maxn 1005 vector g[maxn*2]; b...
分类:其他好文   时间:2014-06-28 07:52:39    阅读次数:197
给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该结点
#include #include #include #include using namespace std; struct Node { int data; struct Node* next; }; struct Node* create_list(int len) { if (len <= 0) return NULL; struct Node* head; ...
分类:其他好文   时间:2014-06-27 23:54:36    阅读次数:311
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!