摘要:
#include <iostream> #include <set> using namespace std; int main() { set<int> data = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; cout << "初始数据: "; for( 阅读全文
posted @ 2025-10-08 11:31
付书恒
阅读(2)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <set> #include <vector> using namespace std; int main() { // 1. 默认构造函数 set<int> emptySet; // 2. 初始化列表(自动去重和排序) set<int> n 阅读全文
posted @ 2025-10-08 11:30
付书恒
阅读(3)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <set> using namespace std; int main() { set<int> data = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; cout << " 查找操作详解 " << 阅读全文
posted @ 2025-10-08 11:30
付书恒
阅读(3)
评论(0)
推荐(0)
摘要:
#include <bits/stdc++.h> using namespace std; int main() { set<int> numbers; cout << " 插入操作详解 " << endl; // 1. insert 单个元素 auto result1 = numbers.inse 阅读全文
posted @ 2025-10-08 11:29
付书恒
阅读(2)
评论(0)
推荐(0)
摘要:
#include <utility> #include <cmath> #include <iostream> // 返回平方和平方根 std::pair<int, int> calculate(int x) { return {x+x,x*2}; } int main() { std::pair< 阅读全文
posted @ 2025-10-08 11:29
付书恒
阅读(3)
评论(0)
推荐(0)
摘要:
#include <iostream> #include <algorithm> class Buffer { private: int* data_; size_t size_; public: // 构造函数 Buffer(size_t size = 0) : size_(size) { dat 阅读全文
posted @ 2025-10-08 11:28
付书恒
阅读(3)
评论(0)
推荐(0)