exam10-1.cpp
来自「里面包含各种数据结构方面的知识,如链表,树,图等 含有vc代码」· C++ 代码 · 共 23 行
CPP
23 行
#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 + =
减小字号Ctrl + -
显示快捷键?