实验 3

news/2025/11/26 0:13:22/文章来源:https://www.cnblogs.com/Luzzzi/p/19260027

task 1

Button.hpp

 1 #pragma once
 2 
 3 #include<iostream>
 4 #include<string>
 5 
 6 class Button {
 7 public:
 8     Button(const std::string& label_);
 9     const std::string& get_label() const;
10     void click();
11 
12 private:
13     std::string label;
14 };
15 
16 Button::Button(const std::string& label_) :label{ label_ } {
17 }
18 
19 inline const std::string& Button::get_label() const {
20     return label;
21 }
22 
23 inline void Button::click() {
24     std::cout << "Button '" << label << "' clicked\n";
25 }
Button.hpp

window.hpp

 1 #pragma once
 2 
 3 #include<iostream>
 4 #include<vector>
 5 #include<algorithm>
 6 #include"Button.hpp"
 7 
 8 class window{
 9 public:
10     window(const std::string& title_);
11     void display() const;
12     void close();
13     void add_button(const std::string& label);
14     void click_button(const std::string& label);
15 
16 private:
17     bool has_button(const std::string& label) const;
18 
19 private:
20     std::string title;
21     std::vector<Button> buttons;
22 };
23 
24 window::window(const std::string& title_) :title(title_) {
25     buttons.push_back(Button("close"));
26 }
27 
28 inline void window::display() const {
29     std::string s(40, '*');
30     std::cout << s << std::endl;
31     std::cout << "window:" << title << std::endl;
32     int cnt = 0;
33     for (const auto& button : buttons)
34         std::cout << ++cnt << "." << button.get_label() << std::endl;
35     std::cout << s << std::endl;
36 }
37 
38 inline void window::close() {
39     std::cout << "close window '" << title << "'" << std::endl;
40     click_button("close");
41 }
42 
43 inline bool window::has_button(const std::string& label) const {
44     for (const auto& button : buttons)
45         if (button.get_label() == label)
46             return true;
47 
48     return false;
49 }
50 
51 inline void window::add_button(const std::string& label) {
52     if(has_button(label))
53         std::cout << "button "<<label<<" already exists!\n";
54     else
55         buttons.push_back(Button(label));
56 }
57 
58 inline void window::click_button(const std::string& label) {
59     for(auto &button:buttons)
60         if (button.get_label() == label) {
61             button.click();
62             return;
63         }
64 
65     std::cout << "no button:" << label << std::endl;
66 }
window.hpp

task1.cpp

 1 #include"window.hpp"
 2 #include<iostream>
 3 
 4 void test() {
 5     window w("Demo");
 6     w.add_button("add");
 7     w.add_button("remove");
 8     w.add_button("modify");
 9     w.add_button("add");
10     w.display();
11     w.close();
12 }
13 
14 int main() {
15     std::cout << "用组合类模拟简单GUI:\n";
16     test();
17 }
task 1.cpp

image

 Q1:Button和window是组合关系。

Q2:

(1):优点:可以在类外部查询是否存在某一按钮,直接调用接口就可知道结果。

           风险:has_button本质是window类内部管理按钮的辅助函数,会暴露其遍历vector的实现细节。

(2)如果是函数的核心功能,用户要直接调用的话用public,如果是辅助内部功能的实现则用private;如果函数内部无论怎么修改,功能和返回值都稳定,用public,如果函数的逻辑会因为内部修改而发生改变,则用private;若经过设计,外部调用不会破坏对象状态,则用public;若函数直接操作类的私有成员,且外部调用可能导致对象状态不一致,用private。

Q3:

接口1:返回已有的字符串,不产生新对象;通过const,外部无法修改字符串,保证内部数据安全。

接口2:创建字符串副本并返回,涉及内存分配和完整数据复制,有额外内存消耗;返回的是副本,外部修改副本数据并不会影响内部数据。

Q4:程序可以正常运行。

xx.push_back(Button(xxx)):先创建临时Button对象Button(“close”),再将临时对象移动到vector中,最后销魂临时对象。
xx.emplace_back(xxx):直接在vector为新元素预留的内存中调用Button的构造函数Button(“close”),完成对象创建。
 
 
 
task 2
 1 #include<iostream>
 2 #include<vector>
 3 
 4 void test1();
 5 void test2();
 6 void output1(const std::vector<int>& v);
 7 void output2(const std::vector<int>& v);
 8 void output3(const std::vector<std::vector<int>>& v);
 9 
10 int main() {
11     std::cout << "深复制验证1:标准库vector<int>\n";
12     test1();
13 
14     std::cout << "\n深复制验证2:标准库vector<int>嵌套使用\n";
15     test2();
16 }
17 
18 void test1() {
19     std::vector<int> v1(5, 42);
20     const std::vector<int> v2(v1);
21 
22     std::cout << "**********拷贝构造后**********\n";
23     std::cout << "v1:";output1(v1);
24     std::cout << "v2:";output1(v2);
25 
26     v1.at(0) = -1;
27 
28     std::cout << "**********修改v1[0]后**********\n";
29     std::cout << "v1:";output1(v1);
30     std::cout << "v2:";output1(v2);
31 }
32 
33 void test2() {
34     std::vector<std::vector<int>> v1{ {1,2,3},{4,5,6,7} };
35     const std::vector<std::vector<int>> v2(v1);
36 
37     std::cout << "**********拷贝构造后**********\n";
38     std::cout << "v1:";output3(v1);
39     std::cout << "v2:";output3(v2);
40 
41     v1.at(0).push_back(-1);
42 
43     std::cout << "**********修改v1[0]后**********\n";
44     std::cout << "v1:";output3(v1);
45     std::cout << "v2:";output3(v2);
46 }
47 
48 void output1(const std::vector<int>& v) {
49     if (v.size() == 0) {
50         std::cout << '\n';
51         return;
52     }
53 
54     std::cout << v.at(0);
55     for (auto i = 1;i < v.size();++i)
56         std::cout << "," << v.at(i);
57     std::cout << '\n';
58 }
59 
60 void output2(const std::vector<int>& v) {
61     if (v.size() == 0) {
62         std::cout << '\n';
63         return;
64     }
65 
66     auto it = v.begin();
67     std::cout << *it;
68 
69     for (it = v.begin() + 1;it != v.end();++it)
70         std::cout << "," << *it;
71     std::cout << '\n';
72 }
73 
74 void output3(const std::vector<std::vector<int>>& v) {
75     if (v.size() == 0) {
76         std::cout << '\n';
77         return;
78     }
79 
80     for (auto& i : v) 
81         output2(i);
82 }
task 2.cpp

image

 Q1:

std::vector<int> v1(5,42):vector的填充构造函数,创建一个有5个元素的向量v1,每个元素初始值为42,有5个为42的值。

const std::vector<int> v2(v1):vector的 拷贝构造函数,v2深拷贝v1,与v1完全相同,有5个为42的值。

Q2:v1.size()=2;v2.size()=2;v1[0].size()=3

Q3:可以实现同等效果。v1.at(0)会检查索引是否有效,若超出范围可以自己处理;v1[0]不进行边界检查,若索引越界,会报错。

Q4:

(1)可以输出-1。语句执行后会向v1的第一个向量{1,2,3}最后添加-1这个元素,又把{1,2,3,-1}拷贝给r这个动态向量,r.at(r.size()-1)表示r中的最后一个元素,也就是-1。

(2)cosnt &是对原对象的常量引用,不复制内部向量,仅占一个引用变量的内存;const修饰,通过r无法改变原来向量的内容。

Q5:

(1)标准库模板类 vector 的复制构造函数实现的是深复制。在test1和test2中改变v1向量并不会影响v2向量。

(2)v是vector<int>时,返回int &;v是vector<int>时,返回const int &;at()必须提供带const修饰的重载版本,如果不提供带const的重载版本,那么const std::vector将无法安全调用at()。

 

 

task 3

vectorInt.hpp

 1 #pragma once
 2 
 3 #include<iostream>
 4 
 5 class vectorlnt {
 6 public:
 7     vectorlnt();
 8     vectorlnt(int n_);
 9     vectorlnt(int n_, int value);
10     vectorlnt(const vectorlnt& vi);
11     ~vectorlnt();
12 
13     int size() const;
14     int& at(int index);
15     const int& at(int index) const;
16     vectorlnt& assign(const vectorlnt& vi);
17 
18     int* begin();
19     int* end();
20     const int* begin() const;
21     const int* end() const;
22 
23 private:
24     int n;
25     int* ptr;
26 };
27 
28 vectorlnt::vectorlnt() :n{ 0 }, ptr{ nullptr } {}
29 vectorlnt::vectorlnt(int n_) :n{ n_ }, ptr{ new int[n] } {}
30 
31 vectorlnt::vectorlnt(int n_, int value) :n{ n_ }, ptr{ new int[n_] } {
32     for (auto i = 0;i < n;++i)
33         ptr[i] = value;
34 }
35 
36 vectorlnt::vectorlnt(const vectorlnt& vi) :n{ vi.n }, ptr{ new int[n] } {
37     for (auto i = 0;i < n;++i)
38         ptr[i] = vi.ptr[i];
39 }
40 
41 vectorlnt::~vectorlnt() {
42     delete[] ptr;
43 }
44 
45 int vectorlnt::size() const {
46     return n;
47 }
48 
49 const int& vectorlnt::at(int index) const {
50     if (index < 0 || index >= n) {
51         std::cerr << "IndexError: index out of range\n";
52         std::exit(1);
53     }
54 
55     return ptr[index];
56 }
57 
58 int& vectorlnt::at(int index) {
59     if (index < 0 || index >= n) {
60         std::cerr << "IndexError: index out of range\n";
61         std::exit(1);
62     }
63 
64     return ptr[index];
65 }
66 
67 vectorlnt& vectorlnt::assign(const vectorlnt& vi) {
68     if (this == &vi)
69         return *this;
70 
71     int* ptr_tmp;
72     ptr_tmp = new int[vi.n];
73     for (int i = 0;i < vi.n;++i)
74         ptr_tmp[i] = vi.ptr[i];
75 
76     delete[] ptr;
77     n = vi.n;
78     ptr = ptr_tmp;
79     return *this;
80 }
81 
82 int* vectorlnt::begin() {
83     return ptr;
84 }
85 
86 int* vectorlnt::end() {
87     return ptr + n;
88 }
89 
90 const int* vectorlnt::begin() const {
91     return ptr;
92 }
93 
94 const int* vectorlnt::end() const {
95     return ptr + n;
96 }
vectorInt.hpp

task 3.cpp

 1 #include"vectorInt.hpp"
 2 #include<iostream>
 3 
 4 void test1();
 5 void test2();
 6 void output1(const vectorlnt& vi);
 7 void output2(const vectorlnt& v1);
 8 
 9 int main() {
10     std::cout << "测试1: \n";
11     test1();
12 
13     std::cout << "\n测试2: \n";
14     test2();
15 }
16 
17 void test1() {
18     int n;
19     std::cout << "Enter n:";
20     std::cin >> n;
21 
22     vectorlnt x1(n);
23     for (auto i = 0;i < n;++i)
24         x1.at(i) = (i + 1) * 10;
25     std::cout << "x1:";output1(x1);
26 
27     vectorlnt x2(n, 42);
28     vectorlnt x3(x2);
29     x2.at(0) = -1;
30     std::cout << "x2: "; output1(x2);
31     std::cout << "x3: "; output1(x3);
32 }
33 
34 void test2() {
35     const vectorlnt x(5, 42);
36     vectorlnt y;
37 
38     y.assign(x);
39 
40     std::cout << "x: "; output2(x);
41     std::cout << "y: "; output2(y);
42 }
43 
44 void output1(const vectorlnt& vi) {
45     if (vi.size() == 0) {
46         std::cout << '\n';
47         return;
48     }
49 
50     std::cout << vi.at(0);
51     for (auto i = 1;i < vi.size();++i)
52         std::cout << "," << vi.at(i);
53     std::cout << '\n';
54 }
55 
56 void output2(const vectorlnt& vi) {
57     if (vi.size() == 0) {
58         std::cout << '\n';
59         return;
60     }
61 
62     auto it = vi.begin();
63     std::cout << *it;
64 
65     for (it = vi.begin() + 1;it != vi.end();++it)
66         std::cout << "," << *it;
67     std::cout << '\n';
68 }
task 3.cpp

image

 Q1:没有if(this==&vi)判断是否为自我赋值,如果是自我赋值,先释放了ptr的内存,之后要复制的vi.ptr[i]已经被释放掉了;先delete [] ptr释放旧内存,这时ptr就会变成野指针,若后续分配内存失败就会编译出错。

Q2:

(1)static_cast<const vectorInt*>(this)将当前对象的指针this显式转换为指向const vectorInt类型的指针,强制调用const版本的at()成员函数。转化前的this的类型是vectorInt* const,转化后是const vectorInt* const。const成员函数可以由非const对象调用,通过转换this的类型,确保调用的是 const版本的at()函数。

(2)const_cast<int&>的作用是移除const限定符,将const int&转化为int&,转化前返回值是const int&,转化后是int&。非const版本的at()返回可修改元素引用,但const不行,这样修改让非const对象调用const版本函数时逻辑正确,并且返回可修改的元素引用。

Q3:

v1是非const对象,编译器会优先调用非const版本的begin();v2是const对象,编译器会调用const版本的begin()。

编译器根据调用对象的const属性选择begin()的重载版本:非const对象调用非const版本,const对象调用const版本。

Q4:

std::fill_n(ptr,n,value):从指针ptr 指向的内存地址开始,连续填充 n个元素,每个元素的值均为value。

std::copy_n(vi.ptr,vi.n,ptr):从源地址vi.ptr开始,复制vi.n个元素到目标地址ptr中。

std::copy_n(vi.ptr,vi.n,ptr_tmp):从源地址vi.ptr开始,复制vi.n个元素到临时指针ptr_tmp指向的新内存中。

 

 

task 4

 Matrix.h

 1 #pragma once
 2 
 3 class Matrix{
 4 public:
 5     Matrix(int rows_, int cols_, double value = 0);
 6     Matrix(int rows_, double value = 0);
 7     Matrix(const Matrix& x);
 8     ~Matrix();
 9 
10     void set(const double* pvalue, int size);
11     void clear();
12 
13     const double& at(int i, int j) const;
14     double& at(int i, int j);
15 
16     int rows() const;
17     int cols() const;
18 
19     void print() const;
20 
21 private:
22     int n_rows;
23     int n_cols;
24     double* ptr;
25 };
Matrix.h

Matrix.cpp

 1 #include "Matrix.h"
 2 #include<iostream>
 3 
 4 Matrix::Matrix(int rows_, int cols_, double value) :n_rows{ rows_ }, n_cols{ cols_ }, ptr{ new double[rows_ * cols_ ]}{
 5     if (rows_ <= 0 || cols_ <= 0) {
 6         std::cout << "Error:out of range\n";
 7         std::exit(1);
 8     }
 9 
10     for (auto i = 0;i < rows_ * cols_;++i)
11         ptr[i] = value;
12 }
13 
14 Matrix::Matrix(int rows_, double value) :n_rows{ rows_ }, n_cols{ rows_ }, ptr{ new double[rows_ * rows_] } {
15     if (rows_ <= 0) {
16         std::cout << "Error:out of range\n";
17         std::exit(1);
18     }
19 
20     for (auto i = 0;i < rows_ * rows_;++i)
21         ptr[i] = value;
22 }
23 
24 Matrix::Matrix(const Matrix& x) :n_rows{ x.n_rows }, n_cols{ x.n_cols }, ptr{ new double[x.n_rows * x.n_cols] } {
25     for (auto i = 0;i < x.n_rows * x.n_cols;++i)
26         ptr[i] = x.ptr[i];
27 }
28 
29 Matrix::~Matrix() {
30     delete[] ptr;
31 }
32 
33 void Matrix::set(const double* pvalue, int size) {
34     if (size != n_rows * n_cols) {
35         std::cout << "Error\n";
36         std::exit(1);
37     }
38 
39     for (auto i = 0;i < size;++i)
40         ptr[i] = pvalue[i];
41 }
42 
43 void  Matrix::clear() {
44     for (int i = 0; i < n_rows * n_cols; ++i) 
45         ptr[i] = 0.0;
46 }
47 
48 const double& Matrix::at(int i, int j) const {
49     if (i < 0 || i >= n_rows || j < 0 || j >= n_cols) {
50         std::cout << "Error\n";
51         std::exit(1);
52     }
53     return ptr[i * n_cols + j];
54 }
55 
56 double& Matrix::at(int i, int j) {
57     return const_cast<double&>(static_cast<const Matrix*>(this)->at(i, j));
58 }
59 
60 int Matrix::rows() const {
61     return n_rows;
62 }
63 
64 int Matrix::cols() const {
65     return n_cols;
66 }
67 
68 void Matrix::print() const {
69     for (int i = 0; i < n_rows; ++i) {std::cout << at(i, 0);
70         for (int j = 0; j < n_cols; ++j) {
71             std::cout << ","<< at(i, j) ;
72         }
73         std::cout << "\n";
74     }
75 }

task 4.cpp

 1 #include <iostream>
 2 #include <cstdlib>
 3 #include"Matrix.h"
 4 
 5 void test1();
 6 void test2();
 7 void output(const Matrix& m, int row_index);
 8 
 9 int main() {
10     std::cout << "测试1: \n";
11     test1();
12 
13     std::cout << "\n测试2: \n";
14     test2();
15 }
16 void test1() {
17     double x[1000] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
18 
19     int n, m;
20     std::cout << "Enter n and m: ";
21     std::cin >> n >> m;
22 
23     Matrix m1(n, m); 
24     m1.set(x, n * m); 
25 
26     Matrix m2(m, n); 
27     m2.set(x, m * n); 
28 
29     Matrix m3(n); 
30     m3.set(x, n * n); 
31 
32     std::cout << "矩阵对象m1: \n"; m1.print();
33     std::cout << "矩阵对象m2: \n"; m2.print();
34     std::cout << "矩阵对象m3: \n"; m3.print();
35 }
36 
37 void test2() {
38     Matrix m1(2, 3, -1);
39     const Matrix m2(m1);
40 
41     std::cout << "矩阵对象m1: \n"; m1.print();
42     std::cout << "矩阵对象m2: \n"; m2.print();
43 
44     m1.clear();
45     m1.at(0, 0) = 1;
46 
47     std::cout << "m1更新后: \n";
48     std::cout << "矩阵对象m1第0行 "; output(m1, 0);
49     std::cout << "矩阵对象m2第0行: "; output(m2, 0);
50 }
51 
52 void output(const Matrix& m, int row_index) {
53     if (row_index < 0 || row_index > m.rows()) {
54         std::cerr << "IndexError: row index out of range\n";
55         std::exit(1);
56     }
57 
58     std::cout << m.at(row_index, 0);
59     for (int j = 1; j < m.cols(); ++j)
60         std::cout << ", " << m.at(row_index, j);
61     std::cout << '\n';
62 }
task 4.cpp

image

 

 

task 5

 contact.h

 1 #pragma once
 2 
 3 #include<string>
 4 
 5 class Contact{
 6 public:
 7     Contact(const std::string& name_, const std::string& phone_);
 8 
 9     const std::string& get_name() const;
10     const std::string& get_phone() const;
11     void display() const;
12 
13 private:
14     std::string name; 
15     std::string phone;
16 };
contact.h

contact.cpp

 1 #include "contact.h"
 2 #include <iostream>
 3 #include <string>
 4 
 5 Contact::Contact(const std::string& name_, const std::string& phone_) :name{ name_ },phone{ phone_ } {
 6 }
 7 
 8 const std::string& Contact::get_name() const {
 9     return name;
10 }
11 
12 const std::string& Contact::get_phone() const {
13     return phone;
14 }
15 
16 void Contact::display() const {
17     std::cout << name << ", " << phone;
18 }
contact.cpp

ContactBook.h

 1 #pragma once
 2 
 3 #include<string>
 4 #include<vector>
 5 #include"Contact.h"
 6 
 7 class ContactBook{
 8 public:
 9     void add(const std::string& name, const std::string& phone);
10     void remove(const std::string& name); 
11     void find(const std::string& name) const; 
12     void display() const; 
13     size_t size() const;
14 
15 private:
16     int index(const std::string& name) const;
17     void sort(); 
18 
19 private:
20     std::vector<Contact> contacts;
21 };
ContactBook.h

ContactBook.cpp

 1 #include "ContactBook.h"
 2 #include <iostream>
 3 #include <string>
 4 #include <vector>
 5 #include <algorithm>
 6 #include "contact.h"
 7 
 8 void ContactBook::add(const std::string& name, const std::string& phone) {
 9     if (index(name) == -1) {
10         contacts.push_back(Contact(name, phone));
11         std::cout << name << " add successfully.\n";
12         sort();
13         return;
14     }
15 
16     std::cout << name << " already exists. fail to add!\n";
17 }
18 
19 void ContactBook::remove(const std::string& name) {
20     int i = index(name);
21 
22     if (i == -1) {
23         std::cout << name << " not found, fail to remove!\n";
24         return;
25     }
26 
27     contacts.erase(contacts.begin() + i);
28     std::cout << name << " remove successfully.\n";
29 }
30 
31 void ContactBook::find(const std::string& name) const {
32     int i = index(name);
33 
34     if (i == -1) {
35         std::cout << name << " not found!\n";
36         return;
37     }
38 
39     contacts[i].display();
40     std::cout << '\n';
41 }
42 
43 void ContactBook::display() const {
44     for (auto& c : contacts) {
45         c.display();
46         std::cout << '\n';
47     }
48 }
49 
50 size_t ContactBook::size() const {
51     return contacts.size();
52 }
53 
54 int ContactBook::index(const std::string& name) const {
55     for (auto i=0;i < contacts.size();++i) {
56         if (contacts[i].get_name() == name)
57             return static_cast<int>(i);
58     }
59 
60     return -1;
61 }
62 
63 void ContactBook::sort() {
64     auto n = contacts.size();
65 
66     for (auto i = 0;i < n - 1;++i) {
67         for (auto j = 0;j < n - 1 - i;++i) {
68             if(contacts[j].get_name()>contacts[j+1].get_name())
69                 std::swap(contacts[j], contacts[j + 1]);
70         }
71     }
72 }

task 5.cpp

 1 #include "contactBook.h"
 2 
 3 #include<iostream>
 4 
 5 void test() {
 6     ContactBook contactbook;
 7 
 8     std::cout << "1. add contacts\n";
 9     contactbook.add("Bob", "18199357253");
10     contactbook.add("Alice", "17300886371");
11     contactbook.add("Linda", "18184538072");
12     contactbook.add("Alice", "17300886371");
13 
14     std::cout << "\n2. display contacts\n";
15     std::cout << "There are " << contactbook.size() << " contacts.\n";
16     contactbook.display();
17 
18     std::cout << "\n3. find contacts\n";
19     contactbook.find("Bob");
20     contactbook.find("David");
21 
22     std::cout << "\n4. remove contact\n";
23     contactbook.remove("Bob");
24     contactbook.remove("David");
25 }
26 
27 int main() {
28     test();
29 }
task 5.cpp

 

image

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/976638.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

实验03

实验一 button.hpp#pragma once #include<iostream> #include<string>class Button{ public:Button(const std::string &label_);const std::string &get_label() const;void click();private:std…

pandas创建多sheets excel文件

pandas创建多sheets excel文件import pandas as pddf=pd.read_excel("d:\\test.xlsx")mtlist=[]fklist=[]for i in range(15): mtlist.append("AD-DDC-"+str(i))print(mtlist)fklen=len(mtlist…

直接load Qwen2_5OmniThinkerForConditionalGeneration进行推理时eos token失灵的问题,导致不断生成重复token直至max new tokens触发

https://github.com/QwenLM/Qwen2.5-Omni/issues/371遇到标题里描述的问题,最终的解决方法是:在调用 generate 函数时,显式地重新设置 eos_token_id 和 pad_token_id。代码示例如下:text_ids = model.generate(**i…

第三章 哈希表part01

第三章 哈希表part01**242.有效的字母异位词 ** leetcode链接:https://leetcode.cn/problems/valid-anagram/ 题目描述:给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的 字母异位词。 核心思路:主要考察…

pandas床建多sheets excel文件

pandas床建多sheets excel文件import pandas as pddf=pd.read_excel("d:\\test.xlsx")mtlist=[]fklist=[]for i in range(15): mtlist.append("AD-DDC-"+str(i))print(mtlist)fklen=len(mtlist…

2025年11月睫毛假发拉丝机,拉丝机,扫把丝拉丝机厂家权威推荐,细丝拉丝技术实力与口碑解析!

引言在全球工业制造领域,拉丝机作为关键设备,其性能和质量对于众多行业的生产效率和产品质量起着至关重要的作用。为了给全球用户提供权威、可靠的拉丝机厂家推荐,国际知名的工业设备测评协会开展了一项大规模的专业…

2025年11月混凝土增强纤维丝拉丝机,睫毛假发拉丝机,拉丝机厂家权威推荐,耐磨性能与精度测评!

引言在全球制造业蓬勃发展的当下,拉丝机作为关键的生产设备,其性能和质量直接影响着众多行业的生产效率和产品品质。为了给全球企业提供权威、可靠的拉丝机厂家参考,国际机械制造协会开展了一场全面且严格的测评活动…

2025年11月MBBR管材设备,PPR管材设备,PE管材设备公司推荐,管材机械专业制造与品牌保障口碑之选

2025年11月MBBR管材设备,PPR管材设备,PE管材设备公司推荐:青岛华利德塑料挤出设备有限公司在2025年11月,如果您正在寻找MBBR管材设备、PPR管材设备、PE管材设备等相关产品,那么青岛华利德塑料挤出设备有限公司绝对…

2025年11月PE管材设备,PPR管材设备,PVC管材设备厂商推荐:聚焦管材机械企业综合实力与核心技术

2025年11月PE管材设备,PPR管材设备,PVC管材设备厂商推荐:聚焦管材机械企业综合实力与核心技术在塑料加工行业蓬勃发展的当下,管材设备的质量和性能对于企业的生产和发展至关重要。众多管材设备厂商中,青岛华利德塑…

使用.NET开发并上线一个小智AI对话机器人的MCP服务转接平台

前言 最近小智AI对话机器人在ESP32社区实在是太火了,看过之前文章的小伙伴应该都知道之前有给桌面机器人开发过一个.NET客户端,所以对小智也算是比较熟悉。小智虽然支持MCP(Model Context Protocol)协议来扩展功能,但是…

nginx 代理的请求头设置

反向代理中请求头设置 location /superone/ { proxy_pass http://1xx.xx.xx.xx:1x13/; proxy_redirect default; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward…

全国最好的有机农场推荐——德芳有机农场

一、德芳简介 德芳的故事始于2009年,创始人何女士走遍中国众多地方,遇到这片得天得厚的种植天堂。 农场坐落于江苏盱眙,占地达10平方公里,拥有五大种植园地,富含矿物质的火山岩地质,有可供直饮的水质资源。 德芳…

从网页复制变化内容的一个简单方法

在网页看到了想要复制的内容, 打开F12正欲复制, 但是内容是一段段输出的当想要复制网页中的变化内容时, 打开F12再一个个复制对我来说实在太麻烦了有这样的解决方案:打开F12的控制台, 定义函数:function observeElemen…

2025年11月PMMA板片生产线,EVA板片生产线,PET板片生产线厂家权威推荐,透明板材设备品质红榜发布!

2025年11月PMMA板片生产线,EVA板片生产线,PET板片生产线厂家权威推荐在塑料加工行业蓬勃发展的当下,优质的板片生产线对于众多企业而言至关重要。2025年11月,我们为大家权威推荐一家在板片生产线领域表现出色的企业…

2025年11月管道除锈设备,管道3pe设备,管道内壁喷粉设备厂家推荐,防腐工艺与适配管径测评!

引言在当今的基础设施建设和工业生产领域,管道设备的质量与性能对于整个系统的稳定运行起着至关重要的作用。为了能给广大用户提供具有权威性的管道设备厂家推荐,国际知名的工业设备测评协会开展了一项全面且严谨的测…

实验三 类和对象

实验1 1.源代码#pragma once#include <iostream> #include <string>class Button { public:Button(const std::string &label_);const std::string& get_label() const;void click();private:std:…

2025年11月管道除锈设备,管道涂塑设备,管道设备厂家品牌榜,严苛工况适配性深度解析!

引言在全球管道设备市场中,对于管道设备厂家的评估至关重要。国际管道设备协会曾针对全球范围内的众多管道设备厂家进行了一场全面且权威的测评。此次测评涵盖了技术研发能力、产品性能稳定性、服务质量以及节能环保等…

2025年11月钢管涂塑设备,钢管3PE设备,钢管防腐设备厂商推荐:聚焦机械制造实力与核心技术竞争力

2025年11月钢管涂塑设备,钢管3PE设备,钢管防腐设备厂商推荐:聚焦机械制造实力与核心技术竞争力在2025年11月,当众多企业在寻找优质的钢管涂塑设备、钢管3PE设备以及钢管防腐设备时,青岛涂疆管道科技有限公司无疑是…

2025年11月管道3pe设备,管道设备,管道涂塑设备厂家权威推荐,96小时连续运行稳定性实测!

引言在全球管道设备市场中,产品的质量与性能直接影响着众多行业的发展。为了能为广大企业和用户筛选出优质的管道设备厂家,国际知名的管道设备测评协会开展了一项全面且严谨的测评活动。该协会采用了多维度的测评方法…

2025年11月钢管粉末喷涂设备,钢管设备,钢管3PE设备公司推荐,专业防腐机械制造与品质保障之选

《2025年11月钢管粉末喷涂设备、钢管设备、钢管3PE设备优质公司推荐》在管道防腐设备领域,青岛涂疆管道科技有限公司是众多企业值得信赖的选择。该公司成立于2017年,扎根于山东省青岛市这片产业沃土,是一家专注于管…