摘要: #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 付书恒 阅读(6) 评论(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 付书恒 阅读(7) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; int main(){ int number=42; int *ptr=&number;//ptr 存储 number 的地址 cout<<"变量值:"<<number<<endl; //42 cout<<" 阅读全文
posted @ 2025-10-02 09:59 付书恒 阅读(7) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2025-10-02 09:48 付书恒 阅读(19) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2025-10-02 09:47 付书恒 阅读(3) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2025-10-02 09:41 付书恒 阅读(4) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; int main(){ string you; cin>>you; smatch s; regex b(R"((^[a-zA-Z]+)://([a-zA-Z\d\.]+)/(\w+)\?(\w+)=(\d+) 阅读全文
posted @ 2025-10-01 09:28 付书恒 阅读(5) 评论(0) 推荐(0)
摘要: #include <graphics.h> #include <conio.h> #include <bits/stdc++.h> #include <ctime> struct a1{ int x,y,speed; char c; }; a1 n[300]; int main() { initgr 阅读全文
posted @ 2025-05-03 15:47 付书恒 阅读(19) 评论(0) 推荐(0)
摘要: 17.6字符串类字符串类string是不同于字符数组的字符串处理方式。使用字符串类,需要包含以下头文件:#include<string>在学习过程中,必须分清楚string类和字符数组处理字符串的异同。17.6.1 字符串类:输入输出(cin/cout)可以使用cin和cout来读写string类型 阅读全文
posted @ 2024-11-09 08:50 付书恒 阅读(42) 评论(0) 推荐(0)
摘要: ⦁ 类与对象⦁ C++的核心特性:类C++在c语言的基础上增加了面向对象编程,c++支持面向对象程序设计。类是c++的核心特性,通常被称为用户定义类型。⦁ 什么是类与对象类是抽象的数据类型,它包含了数据的表示和用于处理数据的方法。对象是类的具体实例(可以理解为定义变量)。怎么去创建类?怎么去定义声明 阅读全文
posted @ 2024-11-02 09:40 付书恒 阅读(20) 评论(0) 推荐(0)