diff --git a/DevC++下载与使用.txt b/DevC++下载与使用.txt index 17cfed2..23c2126 100644 --- a/DevC++下载与使用.txt +++ b/DevC++下载与使用.txt @@ -1 +1 @@ -https://zhuanlan.zhihu.com/p/259191634 \ No newline at end of file +https://gitee.com/devcpp/devcpp \ No newline at end of file diff --git a/GESP/GESP C++四级认证试卷2023年6月.pdf b/GESP/GESP C++四级认证试卷2023年6月.pdf index 8be8e23..a577927 100644 Binary files a/GESP/GESP C++四级认证试卷2023年6月.pdf and b/GESP/GESP C++四级认证试卷2023年6月.pdf differ diff --git a/GESP/GESP20240629/4.pdf b/GESP/GESP20240629/4.pdf index de1b8f0..a0338d5 100644 Binary files a/GESP/GESP20240629/4.pdf and b/GESP/GESP20240629/4.pdf differ diff --git a/GESP/GESP2024年3月4级.pdf b/GESP/GESP2024年3月4级.pdf index 0513f18..bb72986 100644 Binary files a/GESP/GESP2024年3月4级.pdf and b/GESP/GESP2024年3月4级.pdf differ diff --git a/GESP/GESP九月四级C++真题.pdf b/GESP/GESP九月四级C++真题.pdf index c9e841f..76e06c6 100644 Binary files a/GESP/GESP九月四级C++真题.pdf and b/GESP/GESP九月四级C++真题.pdf differ diff --git a/GESP/sh.cpp b/GESP/sh.cpp new file mode 100644 index 0000000..9ea4863 --- /dev/null +++ b/GESP/sh.cpp @@ -0,0 +1,10 @@ +#include +using namespace std; +typedef long long LL; +int main() { + int a, b, c; + int x; + cin >> a >> b >> c; + + return 0; +} \ No newline at end of file diff --git a/GESP/sizeof.cpp b/GESP/sizeof.cpp new file mode 100644 index 0000000..723f272 --- /dev/null +++ b/GESP/sizeof.cpp @@ -0,0 +1,47 @@ +#include +using namespace std; + +bool issimilar(string a, string b) { + if (abs((int)a.size() - (int)b.size()) > 1) + return false; + if (a.size() == b.size()) { + int cnt = 0; + for (int i = 0; i < a.size(); i++) { + if (a[i] != b[i]) + if (cnt++ > 1) + return false; + } + return true; + } else { + int cnt = 0; + if (a.size() > b.size()) + swap(a, b); + int j = 0; + for (int i = 0; i < a.size();) { + if (a[i] != b[j]) { + cnt++; + j++; + } else { + i++; + j++; + } + } + if (cnt > 1) + return false; + return true; + } +} + +int main() { + int T; + cin >> T; + while (T--) { + string a, b; + cin >> a >> b; + if (issimilar(a, b)) { + cout << "similar" << endl; + } else + cout << "not similar" << endl; + } + return 0; +} diff --git a/GESP/做题.cpp b/GESP/做题.cpp new file mode 100644 index 0000000..1c9e758 --- /dev/null +++ b/GESP/做题.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +const int N = 1e6 + 10;//ⵥ +int a[N];//ÿⵥ + +int main() { + int n; + cin >> n; + for (int i = 1; i <= n; i++) + cin >> a[i]; + sort(a + 1, a + 1 + n); + + int h = 1;//󣬴Ƚϵⵥ + for (int i = 1;;) { //öÿһ죬breakֹͣ + if (a[h] >= i) //ߵһ + i++; + if (++h > n) { + cout << i - 1 << endl; + break; + } + } + return 0; +} diff --git a/GESP/灰阶图像/1.txt b/GESP/灰阶图像/1.txt new file mode 100644 index 0000000..f637c47 --- /dev/null +++ b/GESP/灰阶图像/1.txt @@ -0,0 +1 @@ +AAAA6AAAA6 \ No newline at end of file diff --git a/GESP/灰阶图像/新文件1.cpp b/GESP/灰阶图像/新文件1.cpp new file mode 100644 index 0000000..f49390c --- /dev/null +++ b/GESP/灰阶图像/新文件1.cpp @@ -0,0 +1,114 @@ +#include +using namespace std; +const int N = 256; +int b[N]; + +int toDec(char a, char b) { + int res = 0; + if (a >= 'A' && a <= 'F') + res += (a + 10 - 'A') * 16; + else + res += (a - '0') * 16; + if (b >= 'A' && b <= 'F') + res += b + 10 - 'A'; + else + res += b - '0'; + return res; +} + +string toHex(int x) { + int a = x % 16; + int b = x / 16; + char c1, c2; + if (a >= 10) + c1 = 'A' + a - 10; + else + c1 = a + '0'; + if (b >= 10) + c2 = 'A' + b - 10; + else + c2 = b + '0'; + string res; + res.push_back(c2); + res.push_back(c1); + return res; +} +vectorq; + +//struct Node { +// int id; +// int cnt; +// const bool operator<(const Node &b)const { +// if (cnt == b.cnt) +// return id < b.id; +// return cnt > b.cnt; +// } +//}; +//Nodeٵˣøɣ +vectorvec; + +int main() { + int n; + cin >> n; + for (int i = 1; i <= n; i++) { + string s; + cin >> s; + q.push_back(s); + for (int j = 0; j < s.size(); j += 2) { + char c1, c2; + c1 = s[j], c2 = s[j + 1]; + int k = toDec(c1, c2); + b[k]++; + } + } +// ѡٿʼ~~~ +// ڣǺܶ256Ҳܸ٣ѡ֣ +// Ҫѡ16壡 +//vec +// vecʱоfor1mx +//mxֵmx_idֵıţ +//һvec! +//ʼɣ +// for (int i = 0; i <= 255; i++) +// if (b[i]) +// vec.push_back({i, b[i]}); + //Ϊ˷ֹɫð䣬ɸһ飬Ȼ¼ѡ +// sort(vec.begin(), vec.end()); + //ɴС + // ǰʮ + for (int i = 0; i < 16; i++) { + int mx, mx_id; + mx = 0, mx_id = -1; + for (int j = 0; j < 256; j++) + if (b[j] > mx) { + mx = b[j]; + mx_id = j; + } + vec.push_back(mx_id); + //important!!! + b[mx_id] = -1; + //Ҫ~ + } + for (int i = 1; i <= 16; i++) + cout << toHex(vec[i]); + cout << endl; + //ڶ~ + for (int i = 0; i < n; i++) { + for (int j = 0; j < q[0].size(); j += 2) { + char c1, c2; + c1 = q[i][j], c2 = q[i][j + 1]; + int x = toDec(c1, c2); + int mi = INT_MAX; + int mi_p = 0; + for (int k = 0; k < 16; k++) { + if (mi > abs(vec[k] - x)) { + mi = abs(vec[k] - x); + mi_p = k; + } + } + cout << toHex(mi_p)[1]; + } + cout << endl; + } + return 0; +} diff --git a/GESP/灰阶图像/无noid版本1.cpp b/GESP/灰阶图像/无noid版本1.cpp new file mode 100644 index 0000000..090a65c --- /dev/null +++ b/GESP/灰阶图像/无noid版本1.cpp @@ -0,0 +1,87 @@ +#include +using namespace std; +const int N = 256; +int b[N]; + +int toDec(char a, char b) { + int res = 0; + if (a >= 'A' && a <= 'F') + res += (a - 'A' + 10) * 16; + else + res += (a - '0') * 16; + if (b >= 'A' && b <= 'F') + res += b - 'A' + 10; + else + res += b - '0' ; + return res; +} + +string toHex(int x) { + int a = x % 16; + int b = x / 16; + char c1, c2; + if (a >= 10) + c1 = 'A' + a - 10; + else + c1 = a + '0'; + if (b >= 10) + c2 = 'A' + b - 10; + else + c2 = b + '0'; + string res; + res.push_back(c2); + res.push_back(c1); + return res; +} +vectorq; + +vectorvec; + +int main() { + + int n; + cin >> n; + for (int i = 1; i <= n; i++) { + string s; + cin >> s; + q.push_back(s); + for (int j = 0; j < s.size(); j += 2) { + char c1 = s[j], c2 = s[j + 1]; + int k = toDec(c1, c2); + b[k]++; + } + } + for (int i = 0; i < 16; i++) { + int mx = 0, mx_id = -1; + for (int j = 0; j < 256; j++) + if (b[j] > mx) { + mx = b[j]; + mx_id = j; + } + vec.push_back(mx_id); + + b[mx_id] = -1; + } + for (int i = 0; i < min(16, (int)vec.size()); i++) + cout << toHex(vec[i]) ; + cout << endl; + + for (int i = 0; i < n; i++) { + for (int j = 0; j < q[0].size(); j += 2) { + int c1 = q[i][j], c2 = q[i][j + 1]; + int x = toDec(c1, c2); + int mi = INT_MAX; + int mi_p = 0; + for (int k = 0; k < min(16, (int)vec.size()); k++) { + if (mi > abs(vec[k] - x)) { + mi = abs(vec[k] - x); + mi_p = k; + } + } + cout << toHex(mi_p)[1]; + } + cout << endl; + } + + return 0; +} diff --git a/GESP/灰阶图像/糖豆版本 2.cpp b/GESP/灰阶图像/糖豆版本 2.cpp new file mode 100644 index 0000000..680103a --- /dev/null +++ b/GESP/灰阶图像/糖豆版本 2.cpp @@ -0,0 +1,102 @@ +#include +using namespace std; + + +//һ16ƵĻҽתΪһ±ֵ +int toDec(char a, char b) { + int res = 0; + if (a >= '0' && a <= '9') + res += (a - '0') * 16; + else if (a >= 'A' && a <= 'F') + res += (a - 'A' + 10) * 16; + + if (b >= '0' && b <= '9') + res += b - '0'; + else if (b >= 'A' && b <= 'F') + res += b - 'A' + 10; + return res; +} + +//һʮƵĻҽֵ[0,255]תʮ[0,FF] +string toHex(int x) { + char c1, c2; + int a = x % 16; // 0 ~ 15 + int b = x / 16; // + if (a >= 10) + c1 = 'A' + a - 10; + else + c1 = '0' + a; + if (b >= 10) + c2 = 'A' + b - 10; + else + c2 = '0' + b; + + string res; + res.push_back(c2); + res.push_back(c1); + return res; +} + +const int N = 256; +//Ͱ +int bucket[N];//0 ~ 255 + +//ԭʼַ +string q[30]; + +//ṹ壬ͰеĻҽװõ +struct Node { + int id;//± + int cnt;// + const bool operator<(const Node &b) const { + if (cnt == b.cnt) + return id < b.id; + return cnt > b.cnt; + } +}; +vector vec;//ҪbucketװNodeŵpУʹýṹ + +int main() { + freopen("D://HuiJie.txt", "r", stdin); + + int n; + cin >> n;//nͼ + for (int i = 1; i <= n; i++) { + string s; + cin >> s; + q[i] = s;//ԭʼַ + for (int j = 0; j < s.size(); j += 2) { + char a = s[j], b = s[j + 1]; + int k = toDec(a, b); //ҽ׶Ӧλ + bucket[k]++; + } + } + + for (int i = 0; i <= 255; i++) + vec.push_back({i, bucket[i]}); + sort(vec.begin(), vec.end()); + + //ǰʮλַӡ + for (int i = 0; i < min(16, (int)vec.size()); i++) + cout << toHex(vec[i].id) ; + cout << endl; + + //ڶʵĻش + for (int i = 1; i <= n; i++) { //öÿԭʼַÿ2һ飬жСӦеһӽ + for (int j = 0; j < q[1].size(); j += 2) { + char a = q[i][j], b = q[i][j + 1]; //0 F ,0 F + int x = toDec(a, b); + int mi = INT_MAX; + int mi_p = 0; + for (int k = 0; k < min(16, (int)vec.size()); k++) { //16зյģΪû16ô + if (mi > abs(vec[k].id - x)) { + mi = abs(vec[k].id - x); + mi_p = k; + } + } + cout << toHex(mi_p)[1]; + } + cout << endl; + } + return 0; +} diff --git a/GESP/灰阶图像/输出文件大小.cpp b/GESP/灰阶图像/输出文件大小.cpp new file mode 100644 index 0000000..2bc80b4 --- /dev/null +++ b/GESP/灰阶图像/输出文件大小.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; + +int main() { + ofstream fout; + fout.open("1.txt"); + for (int i = 1; i <= 10; i++) { + if (i % 5 == 0) { + int x = 6; + fout << x; + } else { + char ch = 'A'; + fout << ch; + } + } + return 0; +} diff --git a/充电桩协议.txt b/充电桩协议.txt new file mode 100644 index 0000000..a7a4cbc --- /dev/null +++ b/充电桩协议.txt @@ -0,0 +1,5 @@ +【吐血整理】99.5%充电桩设备接入的终极指南 云快充协议!——慧哥慧知充电桩开源系统V2.5.5 +https://blog.csdn.net/Roinli/article/details/138178245 + +慧哥充电桩开源平台V2.5.2 【汽车 电动自行车 云快充1.5、云快充1.6、SpringCloud、MySQL、uniapp、redis】 +https://liwenhui.blog.csdn.net/article/details/134773779?spm=1001.2014.3001.5502 diff --git a/蓝桥杯软件/dev-cpp-6.0.exe b/蓝桥杯软件/dev-cpp-6.0.exe new file mode 100644 index 0000000..e8edf01 Binary files /dev/null and b/蓝桥杯软件/dev-cpp-6.0.exe differ