没有合适的资源?快使用搜索试试~ 我知道了~
首页个人账户管理 数据结构课程设计
个人账户管理 数据结构课程设计

数据结构课程设计——个人账户管理,数据结构课程设计——个人账户管理,数据结构课程设计——个人账户管理,数据结构课程设计——个人账户管理,
资源详情
资源评论
资源推荐

#include<stdio.h>
#include<conio.h>
seq_search()
{
int a[10],i,k;
printf("please input ten number");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("please input the key for search");
scanf("%d",&k);
for(i=0;i<10;i++)
{
if(a[i]==k)
{printf("sucess!the number is %d",i+1);
return(0);}
printf("failure");
return(0);}}
half_search()
{
int mid,low,high;
int b[10],m,key,h;
printf("please input ten number:");
for(m=0;m<10;m++)
scanf("%d",&b[m]);
printf("please input the key for search:");
scanf("%d",&h);
low=0;
high=9;
while(low<=high)
{mid=(low+high)/2;
if(b[mid]>h) high=mid-1;
else {if(b[mid]<h) low=mid+1;
else {printf("sucess!");
return(0);}
}
}
printf("failure!");
}
main()
{


















安全验证
文档复制为VIP权益,开通VIP直接复制

评论2