摘要: Vector.hpp #include <iostream> #include <stdexcept> using namespace std; template<typename T> class Vector { private: int length; T *space; public: Ve 阅读全文
posted @ 2024-12-17 20:57 黄骑 阅读(17) 评论(0) 推荐(0)
摘要: pets.hpp #include <iostream> #include <vector> #include <string> using namespace std; using std::string; class MachinePets { protected: string nicknam 阅读全文
posted @ 2024-12-02 22:21 黄骑 阅读(14) 评论(0) 推荐(0)
摘要: GradeCalc.hpp #include <iostream> #include <vector> #include <string> #include <algorithm> #include <numeric> #include <iomanip> using std::vector; us 阅读全文
posted @ 2024-11-20 19:46 黄骑 阅读(19) 评论(0) 推荐(0)
摘要: button.hpp #pragma once #include <iostream> #include <string> using std::string; using std::cout; // 按钮类 class Button { public: Button(const string &t 阅读全文
posted @ 2024-11-04 21:29 黄骑 阅读(22) 评论(0) 推荐(0)
摘要: x.h #include <iostream> #include <math.h> #include <string> using namespace std; using std::string; class T { public: T(int x = 0, int y = 0); T(const 阅读全文
posted @ 2024-10-23 15:53 黄骑 阅读(27) 评论(0) 推荐(0)
摘要: #include <algorithm> //#include <typeinfo> //#include <iomanip> //#include <map> #include <vector> #include <string> #include <iostream> using namespa 阅读全文
posted @ 2024-10-10 21:00 黄骑 阅读(19) 评论(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 16:08 黄骑 阅读(18) 评论(0) 推荐(0)
摘要: #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; // 售价 int sal 阅读全文
posted @ 2023-12-11 19:09 黄骑 阅读(54) 评论(0) 推荐(0)
摘要: 一、1-1、① 使最大值、最小值赋值到对应指针变量 ②全部指向 X首元素地址 1-2、①最大值地址 ②可以 二、2-1、①24 数组s1占用字节数 数组s1长度 ②不能 数组s1没有初值和大小,不能正常创建 ③是 2-2、①字符串 “。。。happy” 的地址 指针变量s1的大小 字符串 “。。。h 阅读全文
posted @ 2023-11-27 19:08 黄骑 阅读(18) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <math.h> #define N 100 void dec_to_n(int x, int n) { if(n == 2) { int i=0, ans=0; while(x != 0) { ans += (x%2)*pow(10,i); 阅读全文
posted @ 2023-11-13 23:15 黄骑 阅读(22) 评论(0) 推荐(0)