seach_bin(a[10],m);。。引发的血案。
来源:互联网 发布:telnet 端口链接失败 编辑:程序博客网 时间:2024/06/07 12:46
#include <iostream>
#include <algorithm>
using namespace std;
int seach_bin(int t[],int k)
{
int low,high,mid;
low = 1;
high = 10;
while(low <= high)
{
mid = (low + high) /2;
if(k == mid) return mid;
else if(k < mid) high = mid - 1;
else if(k > mid) low = mid + 1;
}
return -1;
}
int main()
{
int seach_bin(int t[],int k);
int i,j,a[10],m;
cout<<"input data"<<endl;
for(i = 0; i < 10; i++)
{
cin>>a[i];
}
cout<<"input you want to seacher"<<endl;
cin>>m;
sort(a,a+10);
//错误。。求纠正及解释。。
// int i,j,a[10],m;
//都是INT型的啊。为什么冒出来这么一句。。
// error:initializing argument 1 of 'int seach_bin(int*,int)' 何解??
seach_bin(a[10],m);
cout<<"You want to search data position is"<<m<<endl;
for(i = 0; i < 10; i++)
cout<< a[i]<<"\t";
cout<<endl;
return 0;
}
- seach_bin(a[10],m);。。引发的血案。
- ActiveX引发的“血案”
- size_t引发的血案
- 一个 * 引发的血案
- gets引发的血案
- Print 引发的“血案”
- lease引发的血案
- 一个“-”引发的血案
- MD5引发的血案
- 一个"/"引发的血案
- wrap_content引发的血案
- merge_all引发的血案
- PersistableBundle引发的血案
- 看球引发的血案
- 一个松果引发的血案
- 一个memset引发的血案
- 一条语句引发的血案
- 一条短信引发的血案
- 回圈 (loop)--for...do...done (固定回圈)
- 辗转相除法求最大公约数(最小公倍数)
- 【转】myEclipse 中文 乱码 .
- ado异常代码含义对照表及SQL Access,oracle 数据类型对照表
- 制作jffs2根文件系统
- seach_bin(a[10],m);。。引发的血案。
- Windows套接字IO模型之EventSelect
- oracle 函数sign()、ABS()、decode()、case when、
- [前沿]Mobile web application技术初探
- 内核模块多文件makefile
- zoj 2760 How Many Shortest Path
- jsp乱码问题的解决(引的)
- 哈工大英语协会2011秋季---招新海报
- STM32 IO口学习