浅析C/C++中的switch/case陷阱 先看下面一段代码:
文件main.cpp#includeusing namespace std;int main(int argc, char *argv[]){ int a
=0; switch(a) { case ...
分类:
编程语言 时间:
2014-05-19 07:08:14
阅读次数:
429
本章主要介绍 string vector 和 bitset, 不能贪多,现在本文主要介绍
string 与 vector头文件中最好不要使用namespace std, 因为头文件会直接被预处理器放置到C中std::string 的构造方式:
string s1; string s2(s1); st...
分类:
编程语言 时间:
2014-05-18 20:31:41
阅读次数:
378
首先写一段代码如下:namespace ConsoleApplication3{ class
Program { static void Main(string[] args) { Console.WriteLine("Hello, ...
分类:
数据库 时间:
2014-05-18 20:17:54
阅读次数:
468
using System;using System.Collections.Generic;using
System.Linq;using System.Text;using System.Runtime.InteropServices;using
System.IO;namespace Hello...
分类:
其他好文 时间:
2014-05-18 20:16:27
阅读次数:
309
1 #include "windows.h" 2 #include "tlhelp32.h" 3
#include "iostream" 4 using namespace std; 5 6 #pragma
comment(lib,"kernel32.lib") 7 8 DWORD GetKe...
思路:枚举然后深搜,时间复杂度有点高。代码: 1 #include 2 #include 3
#include 4 #include 5 using namespace std; 6 int a[25]; 7 char c[25]; 8 int
flag; 9 int len;10 int judg...
分类:
其他好文 时间:
2014-05-18 19:51:19
阅读次数:
341
1: #include 2: #include 3: #include 4: #include 5:
#include 6: using namespace std; 7: 8: #define LL(a) a>1; 32: sub_build(subl,
mid, LL(subidx), idx)...
分类:
其他好文 时间:
2014-05-18 19:43:43
阅读次数:
395
#include #include #include #include #include
using namespace boost; using namespace std; class point {public: point(int
a=0,int b=0):x(a),y(b) {}...
分类:
其他好文 时间:
2014-05-18 19:42:18
阅读次数:
290
//#define LOCAL#include#includeusing namespace
std;int const MAX_N=10005;int const MAX_M=100;int const INF=100000000;int
N,M,x[MAX_N],lb,ub;//判断是否满足条件...
分类:
其他好文 时间:
2014-05-18 19:38:50
阅读次数:
378
先序遍历和中序遍历非递归代码:#include #include using
namespace std;typedef struct BinaryTree { int data; struct BinaryTree *rchild,
*lchild;}BinaryTree;int cr...
分类:
其他好文 时间:
2014-05-17 21:56:50
阅读次数:
264