摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>struct test{ char* name; int age; int qq;} date[]={ { "solq",18,33333 }, { "wei cheng",20,444444 }, { "hong",55,5555555 }};int sreach(struct test* ar,char* name);int main(int argc, char* argv[]){ 阅读全文
posted @ 2011-08-15 01:42 solq 阅读(387) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>void qsort(int s[], int l, int r){ int i, j, x; if (l < r) { i = l; j = r; x = s[i]; while (i < j) { while(i < j && s[j] > x) j--; /* 从右向左找第一个小于x的数 */ if(i < j) s[i++] = s[j]; while(i < j && s[i] < x) i++; /* 从左向右找第一个大于x的数 */ if(i < j) 阅读全文
posted @ 2011-08-15 00:29 solq 阅读(328) 评论(0) 推荐(0) 编辑