-
实验6
任务1: contestant.hpp #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; // 姓名 s -
实验6 文件I/O与异常处理
实验任务1 程序源代码如下: contestant.hpp 1 #pragma once 2 #include <iomanip> 3 #include <iostream> 4 #include <string> 5 6 struct Contestant { 7 long id; 8 std:: -
实验6 文件I/O与异常处理
实验任务1 源代码: #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; // 姓名 std::strin -
实验6 文件I/O与异常处理
实验任务一: 源代码: #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; // 姓名 std::stri -
Test6
任务一 源代码 contestant.hpp 点我展开代码 #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string nam -
实验五
任务一 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string &name_ = ""); // 构 -
第四章作业
一、贪心策略 排序:将所有区间按照右端点从小到大排序 选点规则:从前往后遍历已排序的区间,如果当前区间的左端点大于当前已选的点,说明这个点无法覆盖当前区间,就在当前区间的右端点处放置一个新点,更新当前点的位置为当前区间的右端点 贪心选择性质分析 将区间按右端点排序后,设区间序列为 [l₁, r₁], -
算法第四次作业
1.关于选点问题的贪心策略,就是按右端点大小将区间排序后从第一个小的开始选右端点,之后若端点在区间就找下一个区间,端点不在那个区间就把那个区间右端点选上以此类推直至最后一个区间。 2.关于算法是否满足贪心选择性质,用反证法可证,前提:把区间按右端点升序排好,第一个区间是(I_1),右端点是(b_1) -
第四章算法作业
一、我的贪心策略 策略:将区间按右端点从小到大排序,遍历区间时,如果当前区间左端点大于上一个选点,则选择当前区间的右端点作为新点。 核心思想:每次选择能覆盖当前未覆盖区间中结束最早的区间的右端点。 二、证明算法满足贪心选择性质 贪心选择性质证明: 设排序后第一个区间为 [a₁, b₁]。 必要性:任 -
实验5
1.实验任务1 Publisher.cpp 点击查看代码 #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &n -
实验5
一、实验结论 1. 实验任务1 程序源代码 Publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &n -
实验六
task1: 源代码: 1 #include <algorithm> 2 #include <iostream> 3 #include <stdexcept> 4 #include <vector> 5 #include "contestant.hpp" 6 #include "utils.hpp" -
实验六
实验 6:文件 I/O 与异常处理 说明 阅读文档 请仔细阅读,明确任务要求、提交方式与截止时间。 实验任务说明 任务 1:验证性实验。读懂、运行、理解代码,掌握 I/O 流、异常处理基础操作。 任务 2:设计性实验。参照验证性任务,完成设计、编码。 实践建议 先独立思考、编码,再查工具;缺少“亲手 -
实验6
task1 (1) 1 #pragma once 2 #include <iomanip> 3 #include <iostream> 4 #include <string> 5 6 struct Contestant { 7 long id; // 学号 8 std::string name; / -
实验六
实验任务一 代码 contestant.hpp 点击查看代码 #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string na -
实验六
实验任务1: contestant.hpp 1 #pragma once 2 #include <iomanip> 3 #include <iostream> 4 #include <string> 5 6 struct Contestant { 7 long id; // 学号 8 std::st -
高级语言程序设计第十次作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号:102500308 姓名:郭心悦 (1)编写一个程序, -
高级语言程序设计第十次作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号 102500415 姓名 林帅前 1. 2. 3. 4 -
实验五
任务一: 源代码task1.cpp #include <memory> #include <iostream> #include <vector> #include "publisher.hpp" void test1() { std::vector<Publisher *> v; v.push_b -
高级程序语言第10次
这个作业属于:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业的要求:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号:102500416 姓名:王浩宇 第一题 第二题 第三题 第四题