摘要: 实验任务1 源代码如下 contestant.hpp #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; 阅读全文
posted @ 2025-12-22 16:44 勤垦原 阅读(5) 评论(1) 推荐(0)
摘要: 实验任务1 源代码如下 publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = "") 阅读全文
posted @ 2025-12-16 19:13 勤垦原 阅读(9) 评论(1) 推荐(0)
摘要: 实验任务1 运行结果截图如下 问题1 GradeCalc 类声明中,体现"组合"关系的成员声明及对应功能如下: std::vector<int> grades; grades用于存储所有成绩数据 std::array<int, 5> counts; counts用于统计各分数段人数 std::arr 阅读全文
posted @ 2025-12-02 20:51 勤垦原 阅读(10) 评论(1) 推荐(0)
摘要: 实验任务1 源代码如下: button.hpp #pragma once #include <iostream> #include <string> class Button { public: Button(const std::string &label_); const std::string 阅读全文
posted @ 2025-11-26 00:36 勤垦原 阅读(11) 评论(1) 推荐(0)
摘要: 实验任务1 源代码 T.cpp #include "T.h" #include <iostream> #include <string> // 类T实现 // static成员数据类外初始化 const std::string T::doc{"a simple class sample"}; con 阅读全文
posted @ 2025-10-28 21:44 勤垦原 阅读(13) 评论(2) 推荐(0)
摘要: 1. 实验任务1 验证性实验。 在C++编码环境中,输入、运行并观察以下代码,结合运行结果和注释,体验使用C++标准库进行编程的便捷性。从面 向对象编程范式的角度,体会封装与基于接口编程的意义。 #include <iostream> #include <string> #include <vect 阅读全文
posted @ 2025-10-17 22:35 勤垦原 阅读(27) 评论(1) 推荐(1)