-
第四章作业
一、贪心策略 排序:将所有区间按照右端点从小到大排序 选点规则:从前往后遍历已排序的区间,如果当前区间的左端点大于当前已选的点,说明这个点无法覆盖当前区间,就在当前区间的右端点处放置一个新点,更新当前点的位置为当前区间的右端点 贪心选择性质分析 将区间按右端点排序后,设区间序列为 [l₁, r₁], -
高级语言程序设计第十次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx/ 这个作业要求在哪里: https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号:102500434 姓名:王志勇 1. 2. 3. -
实验5 多态
实验任务1: 1.源代码 #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_): name {nam -
实验五
任务一 代码 1 #pragma once 2 #include <string> 3 // 发行/出版物类:Publisher (抽象类) 4 class Publisher { 5 public: 6 Publisher(const std::string &name_ = ""); // 构造 -
实验5
#任务1 ##代码 ###publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::st -
高级语言程序设计第十次作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号:102500417 姓名:刘朝榕 设计程序 1编写一个 -
实验5
实验任务一 #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构造函数 virtual ~P -
高级语言程序设计课程第十次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里: https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号:102500311 姓名:王梓涵 (1)编写一个程序 -
实验五
任务一 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string &name_ = ""); // 构 -
实验5 多态
##实验任务1 publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // -
实验5 多态
任务1: 代码 #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构造函数 virtual -
实验05
1.实验任务1 publisher.hpp #pragma once #include<string> class Publisher{ public: Publisher(const std::string &name_=""); virtual ~Publisher()=default; pub -
实验五
任务1: 问题1. (1) Publish存在纯虚函数talk() (2) 不能,抽象类无法实例化 问题2. (1) publish和use两个函数, virtual void publish() = 0 ; (2) 问题3. (1) Publish* (2) Book,Film,Music (3) -
实验5
一、实验结论 1. 实验任务1 程序源代码 Publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &n -
实验5 多态
实验5 实验任务1 源代码 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string &name_ = -
第四章算法作业
一、我的贪心策略 策略:将区间按右端点从小到大排序,遍历区间时,如果当前区间左端点大于上一个选点,则选择当前区间的右端点作为新点。 核心思想:每次选择能覆盖当前未覆盖区间中结束最早的区间的右端点。 二、证明算法满足贪心选择性质 贪心选择性质证明: 设排序后第一个区间为 [a₁, b₁]。 必要性:任 -
实验5
任务1: #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_): name {name_} { } -
实验5
1.实验任务1 Publisher.cpp 点击查看代码 #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &n -
实验5
任务一: publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string &na -
实验5 多态
1. 实验任务1 publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string