#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::vector<int> numbers = {8, 3, 1, 7, 6, 2, 5, 4};
    int target = 3;

    // 使用 std::find() 函数在向量中查找指定的元素
    auto result = std::find(numbers.begin(), numbers.end(), target);

    // 检查是否找到元素，并输出结果
    if (result != numbers.end()) {
        std::cout << "Element " << target << " found at position " << std::distance(numbers.begin(), result) << std::endl;
    } else {
        std::cout << "Element " << target << " not found in the vector." << std::endl;
    }

    return 0;
}
