📄 exam10-1.cpp
字号:
#include <iostream.h>
#include <stdlib.h>
typedef int KeyType;
struct DataType
{
KeyType key;
};
#include "BiSearch.h"
void main(void)
{
DataType test[8] = {4,6,7,8,9,11,13,15};
KeyType key = 11;
int n = 8, i;
if((i = BiSearch(test, n, key)) != -1)
cout << "查找成功! 该元素为第" << i << "个元素";
else cout << "查找失败! 该元素在数据元素集合中不存在";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -