09 2015 档案

摘要:1 #include 2 #include 3 4 int binsearch(int x,int v[],int n);//函数声明 5 6 int main() 7 { 8 int arr[]={1,2,3,4,5,6,7,8,9,10}; 9 int 结果,num;10... 阅读全文
posted @ 2015-09-13 00:11 haxnt 阅读(670) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 //顺序查找基本思想:从线性表的一端开始,逐个检查关键字是否满足给定的条件 4 int SequentialSearch(int *a,int n,int x); 5 6 int main(void) 7 { 8 int m[10]={2,... 阅读全文
posted @ 2015-09-12 00:37 haxnt 阅读(919) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 void BubbleSort(int *a,int n); 4 5 int main(void)//入口函数,整型,无参数 6 { 7 int k; 8 int a[10]={2,4,6,8,0,1,3,5,7,9}; 9 ... 阅读全文
posted @ 2015-09-10 10:22 haxnt 阅读(244) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 4 void swap(int x,int y); 5 void swap_p(int *px,int *py); 6 #define swap_m(x,y,t) ((t)=(x),(x=(y),(y)=(t)))//宏函数 7 int main(... 阅读全文
posted @ 2015-09-10 10:19 haxnt 阅读(901) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 void SelectSort(int *a,int n);//预声明要调用的函数 4 int main(void) 5 { 6 int k; 7 int x[10]={2,4,6,8,0,1,3,5,7,9}; 8 for... 阅读全文
posted @ 2015-09-10 01:23 haxnt 阅读(275) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 4 5 int main(void) 6 { 7 8 int a[]={1,2,3,4,5};//a[i]相当于*(a+i) 9 10 printf("a=%d\n",a[4]);11 printf("a... 阅读全文
posted @ 2015-09-02 16:45 haxnt 阅读(428) 评论(0) 推荐(0)