码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
C++进制转换(十进制转二进制、八进制、随意进制)
十进制转二进制://十进制转二进制#includeusing namespace std;void printbinary(const unsigned int val){ for(int i = 16; i >= 0; i--) { if(val & (1 #include using name....
分类:编程语言   时间:2014-06-25 21:11:01    阅读次数:241
hash_map
#include #include int main( ){ using namespace std; using namespace stdext; hash_map hm1; hash_map :: const_iterator hm1_AcIter, hm1_RcIter;...
分类:其他好文   时间:2014-06-25 20:57:59    阅读次数:140
第一讲 pair的用法
#include "stdafx.h"#include#include#includeusing namespace std;int _tmain(int argc, _TCHAR* argv[]){ pairoPoint; //必须包含std oPoint.first = 1; ...
分类:其他好文   时间:2014-06-25 20:23:53    阅读次数:202
第二讲 auto_ptr智能指针
// STL.cpp : 定义控制台应用程序的入口点。////智能指针在其生命周期结束后会自动调用delete#include "stdafx.h"#include#includeusing namespace std;class WebSite{public: WebSite(int x){...
分类:其他好文   时间:2014-06-25 20:09:38    阅读次数:216
POJ 2891 Strange Way to Express Integers 中国剩余定理
裸题,上模版,,嘿嘿 #include #include #include #include #include #include #include #include #include using namespace std; #define ll __int64 ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a%b); } //求一组解(x,y...
分类:其他好文   时间:2014-06-25 19:51:56    阅读次数:138
C++链表-最简单
struct student{ long num; float score; struct student *next;};注意:只是定义了一个struct student类型,并未实际分配存储空间。只有定义了变量才分配内存单元。#includeusing namespace std;int mai...
分类:编程语言   时间:2014-06-24 22:24:45    阅读次数:318
待修改 nyoj 412
测试好多数据都正确,一直wrong ans 仔细思考 #include#include//x&-x 为x的二进制中最低位1的权值 列: 110010为 2 11100为4 ,所以 log2(4)表示最低位1在第2位using namespace std;int lowbit(int n){ retu...
分类:其他好文   时间:2014-06-24 14:29:45    阅读次数:150
生产者与消费者的一个简单例子
生产者#include#include#includeusing namespace std; int main(void) { ofstream out; const char ch = '*'; long long k = 0; DWORD64 time = GetTickCount64(); ...
分类:其他好文   时间:2014-06-24 11:29:19    阅读次数:354
正则表达式
#include const char* first = "";//需要验证的字符std::regex rx("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X|x)$");//验证的表达式,这个是...
分类:其他好文   时间:2014-06-24 11:13:54    阅读次数:164
uva 11143
1 #include 2 #include 3 #include 4 #define maxn 5100 5 #include 6 using namespace std; 7 8 struct node 9 { 10 int x,y; 11 int id; 1...
分类:其他好文   时间:2014-06-24 11:04:10    阅读次数:150
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!