随笔分类 - C
摘要:#include #include #include #include #include #include double atof_num(char s[]){ double val,power = 1.0; int i,sign,j,val_lat = 0; for(i = 0;...
阅读全文
摘要:#include #include #include #include #include #include #define Num 20int strindex(char s[],char t[]){ int i,j,k; int position = -1; for(i = 0;...
阅读全文
摘要:#include #include #include #include #include void reverse(char s[]){ int c,i,j; for(i = 0,j = strlen(s) - 1;i < j;i++,j--) c = s[i],s[i] ...
阅读全文
摘要:#include #include #include #include #include void reverse(char s[]){ int c,i,j; for(i = 0,j = strlen(s) - 1;i < j;i++,j--) c = s[i],s[i] ...
阅读全文
摘要:#include #include #include #include #include void reverse(char s[]){ int c,i,j; for(i = 0,j = strlen(s) - 1;i < j;i++,j--) c = s[i],s[i] ...
阅读全文
摘要:#include #include #include #include int main(){ char c; int i,j; char str1[] = "ABCDa-z0-9",str2[50]; i = j = 0; while((c = str1[i++]) ...
阅读全文
摘要:转自:http://blog.csdn.net/xgmiao/article/details/9570825点击打开链接数组作为函数实参:C语言中数组作为函数实参时,编译器总是将其解析为指向数组首元素地址的指针(地址调用)原因:我们知道C语言函数的调用有传值和传地址调用。假设C语言对数组采用传值调用...
阅读全文
摘要:转载自:http://blog.csdn.net/v_july_v/article/details/8203674/从K近邻算法、距离度量谈到KD树、SIFT+BBF算法前言 前两日,在微博上说:“到今天为止,我至少亏欠了3篇文章待写:1、KD树;2、神经网络;3、编程艺术第28章。你看到...
阅读全文
摘要:#include #define Num 1000int main(){ int i = 0,j,k,count2 = 0; char s[Num] = {'\0'},t[Num]; int c; while((c = getchar()) != EOF ) { ...
阅读全文
摘要:#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...
阅读全文
摘要:#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...
阅读全文
摘要:#include /*int bitcount(unsigned x){ int b; for(b = 0;x != 0;x >>= 1) { if(x & 1) b++; } return b; }*/int bitcount(unsi...
阅读全文
摘要:#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...
阅读全文
摘要:转载自:点击打开链接 http://blog.csdn.net/weilaixi/article/details/3927826一、位运算符C语言提供了六种位运算符:& 按位与| 按位或^ 按位异或~ 取反> 右移1. 按位与运算 按位与运算符"&"是双目运算符。其功能是参与运算的两数各对应的二进位...
阅读全文
摘要:#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...
阅读全文
摘要:#include #include #define Num 10int main(){ int c,i,j = 0,m,n = 0,count1 = 0,count2 = 0; char s[Num],t[Num],st[Num],str[Num]; printf("Please ...
阅读全文
摘要:文章转自: http://liuzhigong.blog.163.com/blog/static/178272375201133104113718/ strcasecmp(忽略大小写比较字符串) 相关函数 bcmp,memcmp,strcmp,strcoll,strncmp 表头文件 #in...
阅读全文
摘要:文章转自:http://blog.csdn.net/turkeyzhou/article/details/6104135有四种方式:1。使用堆空间,返回申请的堆地址,注意释放2。函数参数传递指针,返回该指针3。返回函数内定义的静态变量(共享)4。返回全局变量******************以下摘...
阅读全文
摘要:#include #define Num 10int atoi(char s[]);int main(){ int c,i = 0; char s[Num]; int result; while((c = getchar()) != EOF && c != '\n' && i...
阅读全文
摘要:#include #include int htoi(char s[]);main(){ char s1[] = "10"; char s2[] = "2D"; char s3[] = "3f"; char s4[] = "0X4F"; char s5[] =...
阅读全文

浙公网安备 33010602011771号