流云の剑舞秋风

吾生也有涯 而知也无涯

博客园 首页 新随笔 联系 订阅 管理

2005年5月12日 #

摘要: c++中创建动态二维数组的程序代码 动态创建一维数组 int*arr;//itcanbeanyothertype(char,float) arr=newint[n];//nshouldbeintegervariable 动态创建二维数组 int**arr; intN,M; cin>>N>>M; arr=newint*... 阅读全文
posted @ 2005-05-12 16:17 流云 阅读(1236) 评论(0) 推荐(0) 编辑

摘要: 新建一个SDI的工程,所有都是默认.打开资源编辑器,右键,import选择图片导入.使用默认的ID 不要尝试去编辑他,因为他的颜色超过了256.在OnDraw函数中添加如下代码: CDCmemDC;//内存设备场景 CBitmapcb;//位图类对象 CRectrect; GetWindowRect(&rect); cb.LoadBitmap(IDB_BITMAP1);... 阅读全文
posted @ 2005-05-12 14:54 流云 阅读(443) 评论(0) 推荐(0) 编辑

摘要: CStringstrPath; GetCurrentDirectory(MAX_PATH,strPath.GetBuffer(MAX_PATH)); strPath.ReleaseBuffer(); returnstrPath; 阅读全文
posted @ 2005-05-12 14:48 流云 阅读(440) 评论(0) 推荐(0) 编辑

摘要: 检测一个无符号数是不为2^n-1(^为幂): x&(x+1)将最右侧0位改为1位: x | (x+1)二进制补码运算公式: -x = ~x + 1 = ~(x-1) ~x = -x-1 -(~x) = x+1 ~(-x) = x-1 x+y = x - ~y - 1 = (x|y)+(x&y) x-y = x + ~y + 1 = (x|~y)-(~x&y) x^y = (x|y)-(x&... 阅读全文
posted @ 2005-05-12 10:12 流云 阅读(315) 评论(0) 推荐(0) 编辑

摘要: 儒略历 公历 星期 阅读全文
posted @ 2005-05-12 10:07 流云 阅读(3683) 评论(1) 推荐(0) 编辑

摘要: #include #include #include voidmain() { srand((unsigned)time(NULL));//以系统时间作种子,就不会每次都产生一样的序列了 doubletemp=double(rand()%4000+3000)/10000.0;//调节精度 temp=temp<0.5?(temp-0.2):(... 阅读全文
posted @ 2005-05-12 09:42 流云 阅读(528) 评论(0) 推荐(0) 编辑