自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 G:priority queue练习题

G:priority queue练习题总时间限制: 2500ms 内存限制: 131072kB描述我们定义一个正整数a比正整数b优先的含义是:*a的质因数数目(不包括自身)比b的质因数数目多;*当两者质因数数目相等时,数值较大者优先级高。现在给定一个容器,初始元素数目为0,之后每次往里面添加10个元素,每次添加之后,要求输出优先级最高与最低的元素,并把该两元素从容器中删除。输入第一...

2020-03-30 10:04:58 2477

原创 F:我自己的 ostream_iterator

F:我自己的 ostream_iterator描述程序填空输出指定结果#include <iostream>#include <list>#include <string>using namespace std;template <class T1,class T2>void Copy(T1 s,T1 e, T2 x){ for...

2020-03-29 17:37:31 713

原创 C:很难蒙混过关的CArray3d三维数组模板类

C:很难蒙混过关的CArray3d三维数组模板类描述实现一个三维数组模版CArray3D,可以用来生成元素为任意类型变量的三维数组,输出指定结果#include <iostream>#include <iomanip> #include <cstring>using namespace std;template <class T>cl...

2020-03-29 16:45:34 1541

原创 数字图像处理基础(python

数字图像处理基础(python1.numpy库用法1)创建、shape、dtype和astypeimport numpy as np #类似#include创建长度为3的数组a = np.array([1, 2, 3])shape获得形状print(a.shape) # "(3,)" print(a[0], a[1], a[2]) # "...

2020-03-26 11:27:21 413

原创 按距离排序(函数对象

B:按距离排序#include <iostream>#include <cmath>#include <algorithm>#include <string>using namespace std;template <class T1,class T2>struct Closer {// 在此处补充你的代码};int...

2020-03-24 15:47:55 483

原创 山寨版istream_iterator

山寨版istream_iterator总时间限制: 1000ms 内存限制: 65536kB描述模仿C++标准模板库istream_iterator用法,实现CMyistream_iterator使得程序按要求输出#include <iostream>#include <string>using namespace std;template <clas...

2020-03-24 09:42:07 414

原创 魔兽3:开战总结

魔兽3:开战总结(程设大作业c++写写改改好几天的魔兽3终于过啦(虽然还有4,想想就觉得写不出AC的蓝就是我心中的碧海蓝天,耿耿星河即使半夜2:04我也要写总结反思(在没人认识我的地方得瑟1.对指针的掌握非常不牢固关于nullptr和delete用法#include<iostream>using namespace std;int main(){ int * pA =...

2020-03-24 02:05:26 220

原创 Find the Winning Move

Find the Winning Move总时间限制: 3000ms 内存限制: 65536kB描述4x4 tic-tac-toe is played on a board with four rows (numbered 0 to 3 from top to bottom) and four columns (numbered 0 to 3 from left to right). The...

2020-03-22 14:34:13 445

原创 关于两个类互相引用的析构问题

关于两个类互相引用的析构问题写魔兽到3.0时,硬着头皮开始解决司令部类和武士类各自有对方指针的问题,在调用析构函数的时候,会出现如下错误malloc: *** error for object 0x7ffeefbff580: pointer being freed was not allocated解决方法:声明临时变量,解除互相引用的关系 void cut(){ int...

2020-03-17 18:26:10 371

原创 安装pygame时的问题

安装pygame时的问题根据《Python编程从入门到实践》这本书安装了brew和pip3之后使用pip3执行如下代码安装pygame时遇到问题$ pip install --user hg+http://bitbucket.org/pygame/pygame终端卡住看不出执行迹象于是换成下面这样$ pip3 install pygame报错Traceback (most re...

2020-03-14 11:50:24 299

原创 终端无法实现交互的问题

终端无法实现交互的问题message = "If you tell us who you are, we can personalize the messages you see. "message += "\nWhat is your first name? "name = input(message)print("\nHello, " + name + "!\n")简单的交互代码...

2020-03-13 19:18:31 576

原创 Fun和Do(继承和多态

Fun和Do(继承和多态描述程序填空输出指定结果#include <iostream> using namespace std;class A { private: int nVal; public: void Fun() { cout << "A::Fun" << endl; }; void Do() { cout &lt...

2020-03-11 11:50:39 1198

原创 switch支路声明局部变量问题

switch支路声明局部变量问题写魔兽2.0的时候发现了这种情况在每个支路中,声明不同派生类指针,但是普通写法会有如下报错Jump bypasses variable initialization显示跳过了旁路的变量定义,应该是为了防止在该case未成立的情况下,在其他case调用这个变量而在这个程序中,直到遇到switch的“}”右花括号,变量的作用域才终结如果未经定义直接被调用就...

2020-03-11 09:25:25 2049

原创 sudoku(opj作业

sudoku写了一上午的代码不知道哪里错了先记下来#include <iostream>#include <string.h>using namespace std;bool endflag = 0;int gridnum[9][9] = {};bool usedr[9][10] = {};bool usedc[9][10] = {};bool fix[9...

2020-03-09 15:20:38 118

原创 运算符重载

运算符重载(填空题)描述写一个二维数组类 Array2,使得下面程序的输出结果是:0,1,2,3,4,5,6,7,8,9,10,11,next0,1,2,3,4,5,6,7,8,9,10,11,程序:#include <iostream>#include <cstring>using namespace std;class Array2 {/...

2020-03-05 20:58:44 79

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除