摘要: #include #define Num 1000int main(){ int i = 0,j,k,count2 = 0; char s[Num] = {'\0'},t[Num]; int c; while((c = getchar()) != EOF ) { ... 阅读全文
posted @ 2014-10-31 18:08 司空格子Ored 阅读(195) 评论(0) 推荐(0) 编辑
摘要: #include #define Num 1000000/*int binsearch(int x,int v[],int n){ int low,high,mid; low = 0; high = n-1; while(low v[mid]) hig... 阅读全文
posted @ 2014-10-31 14:21 司空格子Ored 阅读(265) 评论(0) 推荐(0) 编辑
摘要: #include int lower(char a){ int b; b = (a >= 'A' && a <= 'Z') ? (a - 'A' + 'a') : a; return b;}int main(){ int c; while((c = getcha... 阅读全文
posted @ 2014-10-31 11:33 司空格子Ored 阅读(336) 评论(0) 推荐(0) 编辑
摘要: #include /*int bitcount(unsigned x){ int b; for(b = 0;x != 0;x >>= 1) { if(x & 1) b++; } return b; }*/int bitcount(unsi... 阅读全文
posted @ 2014-10-31 11:17 司空格子Ored 阅读(203) 评论(0) 推荐(0) 编辑
摘要: #include unsigned setbits(unsigned x, int p, int n, unsigned y){ return (x & ((~0 unsigned invert(unsigned x,int p,int n){ return x ^ ((~(~0U un... 阅读全文
posted @ 2014-10-31 10:57 司空格子Ored 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 转载自:点击打开链接 http://blog.csdn.net/weilaixi/article/details/3927826一、位运算符C语言提供了六种位运算符:& 按位与| 按位或^ 按位异或~ 取反> 右移1. 按位与运算 按位与运算符"&"是双目运算符。其功能是参与运算的两数各对应的二进位... 阅读全文
posted @ 2014-10-31 09:16 司空格子Ored 阅读(709) 评论(0) 推荐(0) 编辑
摘要: #include #include #define Num 1000int main(){ int c,i,j = 0,m = 0,n = 0,k,count1 = 0,count2 = 0,w,h = 0,l = 0,flag2 = 0; char s[Num],t[Num],str... 阅读全文
posted @ 2014-10-31 08:50 司空格子Ored 阅读(267) 评论(0) 推荐(0) 编辑