上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 点击查看代码 #include<iostream> #include<utility> #include<string> #include<map> using namespace std; int main() { //pair定义的两个参数分别是数据成员first和second的类型 pair< 阅读全文
posted @ 2022-09-30 23:04 zhaoo_o 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<cstdio> #include<stack> #pragma warning(disable:4996) using namespace std; int main() { stack<int> st; for (int i = 1; i <= 5; i++) { 阅读全文
posted @ 2022-09-30 23:04 zhaoo_o 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<iostream> #include<cstdio> #include<queue> #include<string> #pragma warning(disable:4996) using namespace std; //建立一个结构体fruit存储水果名称和价格 阅读全文
posted @ 2022-09-30 23:03 zhaoo_o 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<cstdio> #include<map> #pragma warning(disable:4996) using namespace std; int main() { map<char, int> mp; //键char->值int //使用下标访问map容器 m 阅读全文
posted @ 2022-09-30 23:02 zhaoo_o 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<cstdio> #include<queue> #pragma warning(disable:4996) using namespace std; int main() { queue<int> q; //定义队列q,存储int型元素 for (int i = 1; 阅读全文
posted @ 2022-09-30 23:02 zhaoo_o 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<cstdio> #include<vector> using namespace std; #pragma warning(disable:4996) const int maxn = 110; //最多有100个顶点 struct Node { int v; //边 阅读全文
posted @ 2022-09-30 23:01 zhaoo_o 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<cstdio> #include<set> #pragma warning(disable:4996) using namespace std; int main() { /* set<int> st; st.insert(3); //insert(x)将x插入set 阅读全文
posted @ 2022-09-30 23:01 zhaoo_o 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<iostream> #include<string> #include<cstdio> #pragma warning(disable:4996) using namespace std; int main() { //1、定义string型变量并初始化 string 阅读全文
posted @ 2022-09-30 23:01 zhaoo_o 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<iostream> #include<vector> using std::vector; int main() { vector<int> vi; //创建vector容器vi,vi下标从0开始 for (int i = 1; i <= 5; i++) { vi.p 阅读全文
posted @ 2022-09-30 23:00 zhaoo_o 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 点击查看代码 #include<cstdio> #include<stdlib.h> //使用srand()和rand() #include<time.h> //使用time() #include<cmath> //使用round() #include<algorithm> //使用std::swa 阅读全文
posted @ 2022-09-30 22:58 zhaoo_o 阅读(7) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页