自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Javascript(盖楼的基础知识)

JavaScript初级学习

2022-09-18 15:49:24 155 1

原创 链栈---------进出栈

#include <iostream>using namespace std;#define MAXSIZE 20#define TRUE 1#define FALSE 0#define OK 1;#define ERROR 0;typedef bool Status; /* Status是函数的类型,其值是函f数结果状态代码*/typedef int ElemType; typedef struct node { int data;

2021-05-31 15:29:14 76

原创 两栈共享空间

#include <iostream>using namespace std;#define MAXSIZE 20#define TRUE 1#define FALSE 0#define OK 1;#define ERROR 0;typedef bool Status; /* Status是函数的类型,其值是函f数结果状态代码*/typedef int ElemType; typedef struct STACK{ ElemType data[M

2021-05-30 16:24:11 66

原创 c++栈的出栈、进栈

#include <iostream>using namespace std;#define MAXSIZE 20#define TRUE 1#define FALSE 0#define OK 1;#define ERROR 0;typedef bool Status; /* Status是函数的类型,其值是函f数结果状态代码*/typedef int ElemType; typedef struct STACK{ ElemType data[M

2021-05-29 16:29:55 414

原创 leecode 第一题 两数之和

#include <iostream>#include <string>#include <vector>#include <algorithm>using namespace std;class Solution{public: vector<int>twosum(vector<int>& v, int target) { vector<int>a; f

2021-05-24 10:54:58 47

原创 list排序

#include <iostream>#include <string>#include <fstream>//包含头文件 写文本#include <vector>#include <algorithm>#include <deque>#include<list>using namespace std;//显示数据class person{public: person(string name,int

2021-05-18 16:04:53 33

原创 打分 用到容器

#include <iostream>#include <string>#include <fstream>//包含头文件 写文本#include <vector>#include <algorithm>#include <deque>using namespace std;class person{public: person(string name, int score) { this->Name

2021-05-17 10:30:21 36

原创 多态 组装电脑

#include <iostream>#include <string>using namespace std;class Cpu{public: void virtual dogo() = 0;};class Vcard{public: void virtual show() = 0;};class Memry{public: virtual void store() = 0;};//电脑得类 属性是上面三个类class computer

2021-04-14 17:29:33 54

原创 继承

一个类继承多个类语法:class 子类:继承方式 父类1 ,继承方式 父类2#include <iostream>using namespace std;class base1{public: base1() { a = 200; } int a;};class base2{public: base2() { a = 200; } int a;};class son :public base1, public base2{public: son(

2021-04-13 15:36:47 59

原创 this指针/常函数、常对象

解释都在代码后得注释1 this2 *thisusing namespace std;class point{ public: point (int age) { this->age = age;//this指针指向的是被调用函数所属的对象 } //p1在调用 point& personage(point& p) { this->age += p

2021-04-06 16:23:52 141

原创 静态成员、静态函数

静态成员static 数据类型 名字1、所有对象共用一份数据2、类内声明类外初始化#include <iostream>#include <string>using namespace std;class point{public: static int a; //类内定义private:};int point::a = 99; //类外进行初始化

2021-04-02 15:35:24 89

原创 类对象作为类成员

一个类的对象作为另一个对象的成员#include <iostream>#include <string>using namespace std;class car{ public: car(string a) :id(a) { cout << "汽车的构造函数" << endl; } ~car() { cout << "汽车的析构函数" << endl; }private: string id;};

2021-04-02 09:29:12 57

原创 初始化列表

列表的初始话操作传统class point{public:point(int c,int h,int k){ hh = h; sco = c; age = k; }void show(){ cout << hh << endl; cout << sco << endl; cout << age<< endl;}private: int sco; int hh; int age;};int

2021-04-01 17:03:18 39

原创 对象初始化、清理

构造函数、析构函数简单得讲构造函数是给对象属性赋予初值得,而析构函数用于属性得清理。规则:构造函数 类名(){}1、无返回值 不需要写void2、函数名和类名一样3、因为可以给属性赋值,可以发生重载4、只运行一次,不需要调用析构函数 ~类名(){}1、无返回值 不需要写void2、函数名与类名相同在前面加上~3、不可重载4、只运行一次,不需要调用#include <iostream>using namespace std;class point{publi

2021-03-31 17:25:41 72

原创 判断点和圆得位置关系

c++ 黑马笔记#include <iostream>#include<string>#include"circle.h"#include"point.h"#include"iscircle.h"using namespace std;class point{public: void setx(int x1) { x = x1; } int getx() { return x; } void sety(int y1) { y= y1;

2021-03-31 15:26:32 337 1

原创 立方体面积体积,全局/成员函数的判断

从黑马c++学习 自己记一记笔记笔记using namespace std;class Cube{public: //长度 void setl(int l) { L = l; } int getl() { return L; }//宽度 void setW(int w) { W=w; } int getW() { return W; } //高度 void seth(int h) { H=h; } int geth() { r

2021-03-29 15:12:51 99 1

原创 函数重载

函数重载1,必须在同一个作用域下,全局作用域2,函数名字相同3,函数的参数不同,个数不同,或者顺序不同void func(){ cout << "这个是函数func" << endl;}void func(int a){ cout << "这个是函数func(int a)" << endl;}int main(){ func(); func(5); system("pause"); return 0;}...

2021-03-26 14:38:28 46

原创 指针常量、常量指针

const修饰指针常量指针int main(){ int a = 20; int b = 30; const int* p = &a; p = &b; //*p = 30; 会报错 cout << *p << endl; system("pause"); return 0;}常量指针,指针指向的地址可以修改,但是不可以直接解引用重新给它赋值。const修饰常量指针常量int main(){ int a = 20; int b

2021-03-26 09:15:25 44

原创 new开辟数据以及引用

new在堆区开辟数据new创建的数据 其实就是返回这个数据的地址 也就是指针#include<iostream>using namespace std;//new在堆区开辟数据//它返回的是数据对应的地址 也就是指针int* func(){ int* o = new int(10); return o;}int main(){ int*p=func(); cout << *p << endl; cout << *p &lt

2021-03-25 17:27:37 502 2

原创 冲鸭c++代码

c++学习中冒泡排序#include <iostream>using namespace std;int main(){ int arr[] = { 2,5,6,3,9,8,7,7 }; int a = sizeof(arr) / sizeof(arr[0]); cout << a<<endl; int temp; for (int i = 0; i < a-1; i++) { for (int j = 0; j &

2021-03-12 10:42:38 79

空空如也

空空如也

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

TA关注的人

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