摘要: #include<stdio.h>#include<stdlib.h>#define random(x) (rand()%x)//以下写成 a^=b^=a^=b 在gcc version 4.4.1上将不能实现两数交换,必须分开写(在swap()函数内如此连写一样不能正确执行),如果不加if(a!=b)则会出现在调用swap(a,a)后,a=0。#define swap(a... 阅读全文
posted @ 2010-10-19 17:55 weiwelcome0 阅读(497) 评论(0) 推荐(1) 编辑