摘要: 实验1 Complex.hpp #pragma once #include <iostream>#include <stdexcept> // 声明////////////////////////////////////////////////////// 复数模板类声明template<typen 阅读全文
posted @ 2024-12-16 18:36 王青松15252129616 阅读(22) 评论(0) 推荐(0)
摘要: #pragma once #include <iostream>#include <string> using std::cout;using std::endl;using std::string; // 发行/出版物类:Publisher (抽象类)class Publisher {public 阅读全文
posted @ 2024-12-03 20:50 王青松15252129616 阅读(28) 评论(0) 推荐(0)
摘要: task1 #include <iostream> using std::cout; using std::endl; // 类A的定义 class A { public: A(int x0, int y0); void display() const; private: int x, y; }; 阅读全文
posted @ 2024-11-18 16:55 王青松15252129616 阅读(37) 评论(0) 推荐(0)
摘要: #pragma once #include <iostream> #include <string> using std::string; using std::cout; // 按钮类 class Button { public: Button(const string &text); strin 阅读全文
posted @ 2024-11-06 22:28 王青松15252129616 阅读(17) 评论(0) 推荐(0)
摘要: 实验任务1 t.h #pragma once #include<string> class T{ public: T(int x=0,int y=0); T(const T &t); T(T &&t); ~T(); void adjust(int radio); void display() con 阅读全文
posted @ 2024-10-23 08:55 王青松15252129616 阅读(63) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; template<typename T> void output(const T &c); void t 阅读全文
posted @ 2024-10-09 15:06 王青松15252129616 阅读(53) 评论(0) 推荐(0)
摘要: // 将图书信息写入文本文件data1.txt #include <stdio.h> #define N 80 typedef struct { char name[N]; // 书名 char author[N]; // 作者 } Book; int main() { Book x[] = { { 阅读全文
posted @ 2023-12-16 18:18 王青松15252129616 阅读(10) 评论(0) 推荐(0)
摘要: // P286例8.17 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include <stdio.h> #include <string.h> #define N 10 // 运行程序输入测试时,可以把这个数组改小一些输 阅读全文
posted @ 2023-12-12 16:06 王青松15252129616 阅读(14) 评论(0) 推荐(0)
摘要: #include <stdio.h> #define N 5 void input(int x[], int n); void output(int x[], int n); void find_min_max(int x[], int n, int *pmin, int *pmax); int m 阅读全文
posted @ 2023-11-29 16:33 王青松15252129616 阅读(14) 评论(0) 推荐(0)
摘要: #include <stdio.h> #define N 4 void test1() { int a[N] = {1, 9, 8, 4}; int i; // 输出数组a占用的内存字节数 printf("sizeof(a) = %d\n", sizeof(a)); // 输出int类型数组a中每个 阅读全文
posted @ 2023-11-14 23:28 王青松15252129616 阅读(13) 评论(0) 推荐(0)