摘要: 问题 A: 选择法排序 点击查看代码 #include<stdio.h> int main() { int a[10]; int i, m, j, n; for (i = 0; i < 10; i++) scanf("%d", &a[i]); for(j=0;j<9;j++) { for (n = 阅读全文
posted @ 2025-06-17 21:32 这题太难了 阅读(18) 评论(0) 推荐(0)
摘要: 1.图书管理系统* 顺序表实现 点击查看代码 # 图书管理系统 - 顺序表实现 class BookList: def __init__(self): self.books = [] # 使用列表存储图书数据 def input_books(self): """批量输入图书信息""" print(" 阅读全文
posted @ 2025-06-04 19:39 这题太难了 阅读(45) 评论(0) 推荐(0)
摘要: 实验五 哈夫曼编码算法的实现 点击查看代码 #include <iostream> #include <fstream> #include <queue> #include <map> #include <vector> #include <string> #include <bitset> #in 阅读全文
posted @ 2024-12-22 11:56 这题太难了 阅读(19) 评论(0) 推荐(0)
摘要: A 点击查看代码 #include<iostream> #include<algorithm> using namespace std; const int N = 105; #define ll long long ll t, shu[N], n; int main() { cin >> t; s 阅读全文
posted @ 2024-11-21 18:27 这题太难了 阅读(11) 评论(0) 推荐(0)
摘要: c++解释: new相当于malloc()函数,其他没有区别! 点击查看代码 #include<iostream> using namespace std; struct tree { int data; tree* light, *ture; }; int jie, shen,maxx; //创建 阅读全文
posted @ 2024-11-06 14:36 这题太难了 阅读(42) 评论(0) 推荐(0)
摘要: c++: string就是一个数组看成str[N]数组就可以了,其他的好像都一样! 点击查看代码 #include <iostream> #include<string> using namespace std; const int N = 1e7 + 5; struct strs { string 阅读全文
posted @ 2024-11-04 11:30 这题太难了 阅读(56) 评论(0) 推荐(0)
摘要: map是哈希方式,可以改为函数形式,就是传入“+”,“-”返回1,*,/返回2,( 返回 0就行。 点击查看代码 #include<iostream> #include <map> using namespace std; typedef long long ll; const int N = 1e 阅读全文
posted @ 2024-10-14 11:24 这题太难了 阅读(71) 评论(0) 推荐(1)
摘要: 第一种方式为老师说的数组+结构体(课本上),我用的是c++,其实与c没什么不同(区别:cin是scanf,cout是print,new是malloc()函数),我用的全局变量,所以不用传参。 代码1: 点击查看代码 #include<iostream> #include<cstring> using 阅读全文
posted @ 2024-09-23 20:41 这题太难了 阅读(90) 评论(0) 推荐(0)
摘要: (B)N^N (简单快速幂模板,直接套用就行) 点击查看代码 #include<iostream> using namespace std; long long a, b,n; int main() { cin >> n; while(n--) { scanf("%lld", &a); signed 阅读全文
posted @ 2024-08-03 10:58 这题太难了 阅读(47) 评论(0) 推荐(0)
摘要: c-一个欧拉函数模板题 1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { 6 int n; 7 cin >> n; 8 int r = n; 9 for (int i = 2; i * i <= n; i++) 10 { 1 阅读全文
posted @ 2024-07-27 20:09 这题太难了 阅读(42) 评论(0) 推荐(0)