-
高级语言程序第六次个人作业
高级语言程序第六次作业: 本次作业来自:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 本次作业的要求: https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16752 姓名:白嘉成 学号: -
高级语言程序设计第六次作业
高级语言程序设计第六次作业 这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16752 学号:0 -
实验3
task1 源代码 button.hpp #pragma once #include <iostream> #include <string> class Button { public: Button(const std::string &label); const std::string& ge -
实验3
实验3 任务1 源代码 button.hpp #pragma once #include <iostream> #include <string> class Button { public: Button(const std::string& label); const std::string& -
高级语言程序设计第七次作业
高级语言程序设计第七次作业 作业要求https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16753 作业是哪个班级的https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 姓名:王恒毅 学号:010 -
实验3
实验任务1 源码 button.hpp #pragma once #include <iostream> #include <string> class Button { public: Button(const std::string& label); const std::string& get -
高级语言程序设计课程第六次个人作业
这个作业属于2026级高级语言程序设计课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 这个作业的要求:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16752 学号:010260 -
删数问题分析
一、贪心策略 用单调栈从左到右扫描:当栈顶数字大于当前数字且还有删除次数k时,弹出栈顶(即删掉这个较大的高位),再把当前数字压栈。扫描完后若k仍有剩余,从末尾删除。最后去掉前导0。 直观理解:高位越小整个数越小,所以遇到逆序对就删前者。 二、贪心选择性质证明 设i是第一个满足s[i] > s[i+1 -
第四章贪心问题
“删数问题”分析、证明及复杂度 【问题分析】 给定一个n位正整数a,去掉其中任意k(k<=n)个数字后,剩下的数字按原次序排列组成一个新的正整数。目标是找出剩下数字组成的新数最小的删数方案。 【贪心策略】 为了让剩下的数字组成的数最小,我们需要让高位(靠左)的数字尽可能小。 贪心策略如下:从左向右扫 -
高级语言程序设计第四次作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16750 学号:0102600213 姓名:朱 -
高级语言程序设计课程第四次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 这个作业要求在哪里: 学号:0102600210 姓名:李佶宙 6.16练习 7.12练习 -
实验2
任务一 源代码 t.cpp #include "t.h" #include <iostream> #include <stdexcept> #include <string> // static成员数据: 类内声明、类外初始化 const std::string T::doc{"a simple c -
高级语言程序设计课程第五次个人作业
这个作业属于哪个课程:2026高级语言程序设计 这个作业要求在哪里:高级语言程序设计课程第五次个人作业 学号:052101413 姓名:任广湃 一、设计一个getchar和putchar联合使用的程序,使得程序遇到空格符时结束 二、建立一个in.txt和out.txt,分别使用这两个文件进行重定位代 -
高级语言程序设计课程第五次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj 这个作业要求在哪里: https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16751 学号:0102600106 姓名: -
实验2
任务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 -
实验二
实验任务一 源码 t.cpp #include "t.h" #include <iostream> #include <stdexcept> #include <string> // static成员数据: 类内声明、类外初始化 const std::string T::doc{"a simple -
实验2
实验任务1 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(); -
实验3
任务1 源代码1 点击查看代码 #include <stdio.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != EOF) { gra -
第三章作业
1.1 递归方程式 由“必须在 2N-1 个单位时间穿越出去”可知,商人只能向右或向下走。 设 a[i][j] 为格子费用,dp[i][j] 为从左上角走到 (i,j) 的最小通行费(0 下标): dp[0][0] = a[0][0] 第一行: dp[0][j] = dp[0][j-1] + a[0 -
第三章作业
1.实验报告: 1.1 递归方程与边界条件 状态定义:dp [i][j] 表示从起点 (1,1) 走到 (i,j) 的最小通行费,a [i][j] 为该方格费用 最优子结构:到 (i,j) 只能从上方 (i-1,j) 或左方 (i,j-1) 到达,最优解由两个子问题最优解得到 递归方程:dp [i]