顺序查找数据
来源:互联网 发布:windows编程书籍 编辑:程序博客网 时间:2024/06/06 11:58
#include<iostream>using namespace std;int main(){int i, n = 0, num;int a[10];//从键盘输入for (i = 0; i < 10; i++){cout << "a[" << i << "]=";cin >> a[i];}cout << "输入查找的数据" << endl;cin >> num;cout << "输出数组" << endl;for (i = 0; i < 10; i++){cout << a[i] << "\t";if (i % 3 == 0)cout << endl;}cout << endl;for (i = 0; i < 10; i++){if (num == a[i]){cout << "查找的元素" << endl;cout << "a[" << i << "]=" << num << endl;n++;}}if (n == 0)cout << "查找的元素不存在" << endl;system("pause");return 0;}
0 0
- 顺序查找数据
- 数据查找算法---顺序查找、二分法查找、二叉树查找、hash查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- 顺序查找
- intelijj idea下热部署node.js web项目
- opencv-- 使用鼠标绘制矩形并截取和保存矩形区域图像
- 缓存一致性和访存顺序的区别
- 0x00000000 处有未经处理的异常: 0xC0000005: 在位置 0x0000000000000000 发生访问冲突
- ABAP Smartform实例
- 顺序查找数据
- linux 安装jdk-7u67-linux-x64.tar.gz
- 生成所有sequence Yahtzee part 1
- Block在UITableViewcell中的正向和反向传值
- file_put_contents() failed to open stream: Permission denied 问题解决(生成日志文件)
- Windows Server 2012 R2、Windows Server 2012、Windows 8.1 或 Windows 8 上无法启用 Microsoft .NET Framework 3.
- SecureCRT 绝佳配色方案, 保护你的眼睛
- adb shell kill -3 pid
- 【Maven实战】搭建Nexus伺服器