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

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

    // 使用 std::partial_sort() 函数找出前三个最小的元素
    std::partial_sort(numbers.begin(), numbers.begin() + 3, numbers.end());

    // 输出排序后的前三个最小元素
    std::cout << "Smallest three numbers: ";
    for (int i = 0; i < 3; ++i) {
        std::cout << numbers[i] << " ";
    }
    std::cout << std::endl;

    return 0;
}
