【opencv C++版本】安装和学习 ==Windows下使用VSCode配置OpenCV开发环境

ref:https://opencv.org/releases/

ref:https://www.cnblogs.com/ticlab/p/16817542.html

c_cpp_properties.json

复制代码
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/Users/HP/OpenCV-MinGW-Build/x64/mingw/bin"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        }
    ],
    "version": 4
}

照着ref 没安装成功,先写个二分查找把

C++ 复制代码
int search(int a[], int start, int end, int target){
    int mid = (start + end) /2;
    if (target < a[start] || target > a[end] || start >end) {
        return -1;
    }
    if (a[mid] == target){
        return mid;
    } else if (a[mid] >target)
    {
        return search(a, start, mid-1, target);
    } else if (a[mid] < target){
        return search(a, mid+1, end, target);
    }
int main(){
int arr[10] = { 1, 2, 3, 4, 5, 6, 9, 12, 25, 38};
    int key = -1;

    int size = sizeof(arr)/sizeof(arr[0]);
    int result = search(arr, 0, size-1, key);
    result == -1 ? std::cout <<  "在数组中没有找到" << key << "!" << std::endl :  std::cout <<  "在数组中找到" << key << " " << "下标为" << result << std::endl;
    return 0; 
}
    
相关推荐
2301_7833601321 分钟前
【学习笔记】关于RNA_seq和Ribo_seq技术的对比和BAM生成
笔记·学习
qq_3977315122 分钟前
Objective-C 学习笔记(第9章)
笔记·学习·objective-c
ujainu1 小时前
Python学习第一天:保留字和标识符
python·学习·标识符·保留字
sheji34161 小时前
【开题答辩全过程】以 基于Java的应急安全学习平台的设计与实现为例,包含答辩的问题和答案
java·开发语言·学习
WolfGang0073211 小时前
代码随想录算法训练营Day48 | 108.冗余连接、109.冗余连接II
数据结构·c++·算法
喵了meme1 小时前
Linux学习日记21:读写锁
linux·c语言·学习
好奇龙猫1 小时前
日语学习-日语知识点小记-构建基础-JLPT-N3阶段-二阶段(29):第八科文法
学习
崇山峻岭之间2 小时前
C++ Prime Plus 学习笔记041
c++·笔记·学习
_风华ts2 小时前
虚函数与访问权限
c++
1001101_QIA2 小时前
C++中不能复制只能移动的类型
开发语言·c++