自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 排序算法

void bubble_sort(int v[],int n){ for (int i = 0; i < n-1; i++) { for (int j = 0; j < n -1- i; j++) { if (v[j] > v[j + 1]) { swap(v[j], v[j + 1]); } } }}void choose_sort(int v[], int n){ for (int i = 0; i < n; i++) {

2021-05-15 16:51:26 64

原创 STL容器(未完成

一、string#include<iostream>#include<string>using namespace std;/*assign , append , find , rfind , replace , compare , at , insert , erase , string substr(int pos = 0, int n = npos) const; 返回由pos开始的n个字符组成的字符串*/int main(){ string s1

2021-04-17 16:46:34 67

原创 点,线,面,体

未完成,慎重#include<iostream>#include<fstream>#include<vector>#include<iomanip>#include<string>using namespace std;static int sum = -1;class Point{public: int getx() { return _x; } int gety() { return _y; } int getz().

2021-03-28 17:18:34 145

原创 2048

#include<iostream>#include<ctime>#include<cstdlib>#include<conio.h>#include <iomanip>#include<vector>#include<stdlib.h>#define _CRT_SECURE_NO_DEPRECATE#define _CRT_NONSTDC_NO_DEPERECATE#define up 72 /

2021-03-07 14:14:48 52

转载 程序的内存模型

内存四区代码区全局区栈区堆区

2021-03-02 21:49:43 64

原创 C++primer reading notes

假定$是操作系统提示符,可通过“ $ addItems outfile ”使得已经编译的名为addItems.exe 的可执行文件调用infile文件中的数据,并将输出结果写入名为outfile的文件中(两个文件都位于当前目录中)。因为引用不是对象,因此不能定义指向引用的指针 、引用的数组、引用的引用。 int a = 9; int& b = a; int* c = &b;//此处实际上仍是对a操作 //下面都为错误示范 //int&* d = &b;此才为.

2021-01-22 15:44:41 123

原创 类(待补充)

#include<iostream>using namespace std;class rectangle {//定义一个类(矩形)public: int a, b;//定义长和宽(成员变量)。 void inti(int a_, int b_);//设置长和宽。 int area(int, int);//括号内的可以去。 int perimeter();//定义成员函数private: int c;//};void rectangle::inti(int a_, int

2021-01-11 22:03:39 50

原创 12.18work

2)#include<iostream>#include<cmath>#include<vector>using namespace std;int fun(int a);void Swap(int &a, int &b);int ord(vector<int>&, int);int main() { int a[5] = { 19,67,24,11,17 }, b[5] = { 2,3,9,17,59 }; in.

2020-12-25 23:46:15 140 3

原创 12.5 C++work

题目 1、已知一个矩阵,存储在一个二维数组中。将矩阵中和值为最大的那一行元素与首行对换。#include<iostream>#include<cmath>using namespace std;int main(){ double s[10] = { 0 }; int z = 0,b,c; cout << "请输入矩阵的行与列,并再依次输入矩阵元素" << endl; cin >> b>> c; int a[10][

2020-12-06 17:57:51 156

原创 复合类型、string、vector。

#include<iostream>using namespace std;int main() { int b = 1, c = 1; const int a = 1; const int& r1 = a;//必须用const修饰,且不能更改r1,a的值。 auto& r2 = r1;//引用时auto保留const。 decltype(r2)r3 = r2;//r3为const对象。 const int&& r4 = r3+1;//此时r4的

2020-11-18 23:33:04 75

原创 vs2019各类遇到的问题。

1.编译时出现大量莫名文件,导致的错误。1.找到下载器中单个组件的“Windows 通用 CRT SDK”。2.打开项目文件,点击工具栏中的调试,打开属性,更改Windows SDK版本,应用。2.安装时找不到与下列参数匹配的产品。1.直接删除C:\ProgramData\Packages文件,然后再启动安装程序,2.如果在C盘看不到C:\ProgramData目录,是因为该文件为类型为“隐藏的项目”, 所以需要将查看属性勾上显示隐藏文件项,然后就可以在C盘看到了。3.如果提示无删除权限,则需

2020-11-16 23:07:18 917

原创 11.11上机作业C++

1,排序问题。#include<iostream>#include<cmath>using namespace std;int main(){ double a, b, c, d; cout << "请输入三个数"; cin >> a >> b >> c; if (a >= b && b >= c) { cout << a << b << c; }

2020-11-13 23:06:55 155

空空如也

空空如也

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

TA关注的人

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