const 常量
1.在定义时必须被初始值,2.前面不加任何修饰符3.变量名字母一般都大写4.常量可以被子类继承5.一个常量是属于一个类的,而不是某个对象的作用:当某些值是固定不变的,就用const1.const
定义的常量和define()定义的常量的区别?希望一个成员变量不被修改 例如圆周率 3...
分类:
Web程序 时间:
2014-05-28 00:50:10
阅读次数:
371
http://acm.hdu.edu.cn/showproblem.php?pid=3367
1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7
int n,m; 8 int f[m...
分类:
其他好文 时间:
2014-05-28 00:03:30
阅读次数:
451
1、冒泡排序(自己写) #include#define swap(x,y) x=x+y; y=x-y;
x=x-y;void maopao(int *a,int length)
//每次把最大的元素冒泡到数组末尾,从小到大的顺序,length是数组长度,a是数组名,作为形参之后,数组名退化为指针{ ...
分类:
其他好文 时间:
2014-05-27 23:59:27
阅读次数:
434
#include #include #include #include #include
#include #define MAXLINE 80 #define SERV_PORT 6970 void do_echo(int sockfd,
struct sockaddr *pcl...
分类:
系统相关 时间:
2014-05-27 18:06:51
阅读次数:
435
#define LOCAL#include#include#includeusing
namespace std;int main(){#ifdef LOCAL freopen("sscanf.in","r",stdin);
freopen("sscanf.out","w",stdout...
分类:
其他好文 时间:
2014-05-26 18:50:27
阅读次数:
222
本文来自开源中国
http://www.oschina.net/code/snippet_188854_13088#include #include #include
#define CELL 20#define ROWS 25#define COLS 15//升级所需分数值#define SCOR...
分类:
编程语言 时间:
2014-05-26 18:44:41
阅读次数:
413
//简单.... 1 #include 2 #include 3 #include 4
using namespace std; 5 6 #define maxn 105 7 8 struct t 9 {10 int s;11 int e;12
};13 14 t T[maxn]...
分类:
其他好文 时间:
2014-05-25 16:04:07
阅读次数:
215
这题是学着小媛学姐写的.. 1 #include 2 #include 3 #include 4
#include 5 #include 6 using namespace std; 7 #define N 120 8 9 int n, np, nc,
m;10 int cap[N][N];11.....
分类:
其他好文 时间:
2014-05-25 11:44:33
阅读次数:
219
哈希表简单实现,练个手
#include "stdafx.h"
#include
using namespace std;
#define HASHSIZE 12
typedef struct HashTable
{
int *elem;
int count;
}HashTable;
int m = 0;
void Print(HashTable* ...
分类:
其他好文 时间:
2014-05-25 07:02:06
阅读次数:
169
/***************************************************
二叉树的线性存储
by Rowandjj
2014/5/23
***************************************************/
#include
#include
using namespace std;
#define MAX 255
#define...
分类:
其他好文 时间:
2014-05-25 04:25:41
阅读次数:
261