顺序查找
2016-02-13 11:35
316 查看
#include<stdio.h>
#include<stdlib.h>
int shunxuchazhao(int *a,int low,int high,int value)
{
int i;
for(i=low;i<high;i++)
{
if(a[i]==value)
return i;
}
return 0;
}
void main()
{
int j;
int b[9]={4,88,666,9999,6666,3333,7777,44444,55555};
j=shunxuchazhao(&b[0],0,9,88);
printf("%d",j);
system("pause");
}
#include<stdlib.h>
int shunxuchazhao(int *a,int low,int high,int value)
{
int i;
for(i=low;i<high;i++)
{
if(a[i]==value)
return i;
}
return 0;
}
void main()
{
int j;
int b[9]={4,88,666,9999,6666,3333,7777,44444,55555};
j=shunxuchazhao(&b[0],0,9,88);
printf("%d",j);
system("pause");
}
相关文章推荐
- Prime Path(POJ 3126 BFS)
- android TextView 设置字体大小
- JS动态原型
- 关系型数据库是如何运作的
- 上传图片3.0--drp203
- java正则表达式提取xxxx(yyyy)中的内容
- HTML5のWeb SQL
- hdu 4771 Stealing Harry Potter's Precious(bfs)
- 新手学习Cocoapods教程
- Docker实践1:Virtualbox安装Oracle Enterprise Linux R6 U5
- poj2127Greatest Common Increasing Subsequence【LICS】
- 强悍书单:概率与测度论+数理统计+随机过程+金融
- 如何使用SHOW WARNINGS?
- ubuntu 开发板ping通虚拟机挂载nfs服务器
- 守望者的逃离
- 正交表达式
- Android无序广播案例
- Ubuntu下10个厉害的Indicator小程序
- 红黑树
- git使用入门篇