正在加载图片...
测试主函数设计如下: #f include <stdio.h> main(void) { int al-={1,3,4,5,17,18,31,33}; intx=17 int bn: bn= BSearch(a, x, 0,); f(bn=-1) printi"不在数组a中"); else printi("在数组a的下标%d中",bn)12 测试主函数设计如下: # include <stdio.h> main(void) { int a[] = {1, 3, 4, 5, 17, 18, 31, 33}; int x = 17; int bn; bn = BSearch(a, x, 0,7); if(bn == -1) printf("x不在数组a中"); else printf("x在数组a的下标%d中", bn); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有