自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

GOOD LUCK

GOOD LUCK

  • 博客(166)
  • 资源 (1)
  • 收藏
  • 关注

原创 Excel|想对整行进行操作

无论是插入还是删除,右键左侧头部+快捷键迅速完成。插入整行右键+I剪切整行,单击左侧然后ctrl+X,找到想要插入的位置,在他的下面一行左侧头部右键+插入剪切的单元格即可完成。...

2021-07-23 09:27:41 1061

原创 产品|热区用来作为交互的按钮

热区用来作为交互的按钮非常好用

2021-07-07 10:02:54 423

原创 产品|Axure隐藏的动态面板找不到了

热区内一般有动态面板,动态面板会在视图中被隐藏。如何找到被隐藏的动态面板?1.点击右上角工具栏的视图》》重置视图2.可以看到所有的热区标志以及右下角概要:界面内的相关动态模板,可以选择隐藏或者显示。...

2021-07-07 09:41:52 2966

原创 61.C++折半查找实现

#pragma once//折半查找template<class T>int binarySearch(const T list[], int n, const T& key) { int low = 0; int high = n - 1; while (low <= high) { int mid = (low + high) / 2; if (key == list[mid]) { return mid; } else if(key<.

2020-12-20 23:26:50 155

原创 60.C++顺序查找

#pragma once#ifndef _9_13_H#define _9_13_H//用顺序查找的方式查找list中查找值为key的元素template<class T>int seqSearch(const T list[], int n, const T& key) { for (int i = 0; i < n; i++) { if (list[i] == key) { return i; } } return -1;}.

2020-12-20 23:08:06 156

原创 59.C++交换排序-冒泡排序

1.暴力解法#pragma once#ifndef _9_12_H#define _9_12_H//辅助函数交换x,y的值template<class T>void mySwap(T &x, T &y) { T temp = x; x = y; y = temp;}//直接选择排序暴力解法template<class T>void bubbleSort(T a[], int n) { for (int i = 0; i < n.

2020-12-20 22:57:09 111

原创 58.C++直接选择排序

#pragma once#ifndef _9_12_H#define _9_12_H//辅助函数交换x,y的值template<class T>void mySwap(T &x, T &y) { T temp = x; x = y; y = temp;}//直接选择排序template<class T>void selectionSort(T a[], int n) { for (int i = 0; i < n; i++) { .

2020-12-20 22:56:50 63

原创 57.C++实现直接插入算法模版

#pragma once#ifndef HEADER_9_11_H#define HEADER_9_11_H//直接插入排序template<class T>void insertSort(T a[],int n) { int i, j; T temp; //将下标1-n的元素逐个插入到已排序序列中适当的位置 for (int i = 1; i < n; i++) { //从a[i-1]向a[0]扫描,寻找适当的位置插入a[i] int j = i; T.

2020-12-20 22:56:20 100

原创 56.C++队列模版

#pragma once//Queue.h#ifndef QUEUE_H#define QUEUE_H#include<assert.h>//类模板的定义template<class T,int SIZE=50>class Queue {private: int front, rear, count;//队头指针,队尾指针,元素个数 T list[SIZE];//队列元素数组public: Queue();//构造函数,初始化队头指针,队尾指针,元素个数.

2020-12-20 20:18:06 113 1

原创 55.C++栈模板

#pragma once#ifndef STACK_H#define STACK_H#include<assert.h>//模板的定义,SIZE为栈的大小template<class T,int SIZE=50>class Stack {private: T list[SIZE];//数组,用于存放栈的元素 int top;//栈顶位置(数组下标)public: Stack();//构造函数,初始化栈 void push(const T& item).

2020-12-20 20:17:47 135

原创 54.C++链表结点类模板的定义和应用

//Node.h 结点类模板#ifndef NODE_H#define NODE_H//类模板的定义template<class T>class Node {private: Node<T>* next;//指向后继结点的指针public: T data;//数据域 Node(const T& data,Node<T> *next);//构造函数 void insertAfter(Node<T>* p);//在本结点之后插入一.

2020-12-20 20:17:28 2204

原创 53.C++Array类的应用:求范围2~n中的质数

#include<iostream>#include<iomanip>#include"Array.h"using namespace std;//Array类的应用//求范围2~n中的质数int main() {//主函数 Array<int>a(10);//用来存放质数的数组,初始状态有10个元素 int count = 0; int n; cout << "Enter a value >=2 as upper limit .

2020-12-20 20:17:08 364 2

原创 52.C++数组类模板的使用

#ifndef ARRAY_H#define ARRAY_H#include<cassert>//数组类模版定义template<class T>class Array {private: T* list;//T类型指针,用于存放动态分配的数组内存首地址 int size;//数组大小(元素个数)public: Array(int size = 50);//构造函数 Array(const Array<T>& a);//复制构造函数 .

2020-12-20 01:22:06 380 2

原创 51.C++类模板的使用

#include <iostream>using namespace std;//类模版struct Student {//结构体Student int id;//学号 float gpa;//平均分};template<class T>//定义函数模版class Store {//类模板:实现对任意类型数据的存取private: T item;//item用于存放任意类型的数据 bool haveValue;//haveValue用于标记item是否已被.

2020-12-19 23:50:03 281 1

原创 50.C++函数模版的使用

#include <iostream>using namespace std;//函数模版template<class T>//定义函数模版void outputArray(const T *array,int count){ for (int i = 0; i < count; i++) { cout << array[i] << " "; } cout << endl;}int main() {//主函数 c.

2020-12-19 23:49:39 97 1

原创 49.C++以非成员函数函数形式重载Complex的加减运算和<<运算符

#include <iostream>#include <string>using namespace std;class Complex {//复数类定义public://external interface Complex(double r = 0.0, double i = 0.0) :real(r), image(i) {}//构造函数 friend Complex operator+(const Complex& c1,const Complex&am.

2020-12-19 13:09:16 388 2

原创 48.C++将单目运算“++“重载为成员函数

#include <iostream>#include <string>using namespace std;class Clock {//时钟类定义public://外部类借口 Clock(int hour = 0,int minute = 0,int second = 0); void showTime()const; Clock& operator++();//前置单目运算符重载 Clock operator++(int);//后置单目运算符重载p.

2020-12-19 13:08:36 351 1

原创 47.C++复数类加减运算为重载为成员函数形式

#include <iostream>#include <string>using namespace std;class Complex {//复数类定义public://external interface Complex(double r = 0.0, double i = 0.0) :real(r), image(i) {}//constructor function Complex operator+(const Complex& c2) const;.

2020-12-19 13:08:02 494 1

原创 46.C++类型兼容规则实例

#include <iostream>#include <string>using namespace std;class Base1 {public: void display() const { cout << "Base1::display()" << endl; }};class Base2 :public Base1 { void display() const { cout << "Base2::displ.

2020-12-19 13:07:47 165 1

原创 45.C++字符串string的简单应用

#include <iostream>#include <cassert>using namespace std;//根据value的值输出true或者是false,title为提示字inline void test(const char* title, bool value) { cout << title << "returns " << (value ? "true":"false") << endl;}/.

2020-12-19 13:07:22 98

原创 44.C++对象的深复制

#include <iostream>#include <cassert>using namespace std;class Point {public://外部接口 Point() :x(0), y(0) { cout << "Default Constructor called" << endl; } Point(int x, int y) : x(x), y(y) {//构造函数 cout << "Construc.

2020-12-18 09:44:24 93

原创 35.C++访问对象的公有成员函数的几种方式

#include <iostream>using namespace std;//访问对象的公有成员函数的几种方式class Point {public://外部接口 Point(int x=0, int y=0) : x(x), y(y) {} int getX() const { return x; }//const 表示该函数不修改任何值; int getY() const { return y; }private: int x, y;};int main() .

2020-12-18 09:43:57 1680

原创 43.C++对象浅复制

#include <iostream>#include <cassert>using namespace std;class Point {public://外部接口 Point() :x(0), y(0) { cout << "Default Constructor called" << endl; } Point(int x, int y) : x(x), y(y) {//构造函数 cout << "Construc.

2020-12-18 09:43:24 74

原创 42.C++vector应用

#include <iostream>#include <vector>using namespace std;//计算数组arr中元素的平均值double average(const vector<double>& arr) { double sum = 0; for (unsigned i = 0; i < arr.size(); i++) { sum +=arr[i]; } return sum / arr.size();.

2020-12-18 09:43:00 64

原创 41.C++动态创建多维数组

#include <iostream>#include <cassert>using namespace std;//动态创建多维数组int main() {//主函数; float(*cp)[9][8] = new float[8][9][8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 9; j++) { for (int k = 0; k < 8; k++) { .

2020-12-18 09:42:38 201

原创 40.C++动态数组类

#include <iostream>#include <cassert>using namespace std;class Point {public://外部接口 Point() :x(0), y(0) { cout << "Default Constructor called"<<endl; } Point(int x ,int y) : x(x), y(y) {//构造函数 cout << "Constructo.

2020-12-18 09:42:15 130

原创 39.C++动态创建对象数组

#include <iostream>using namespace std;class Point {public://外部接口 Point() :x(0), y(0) { cout << "Default Constructor called"<<endl; } Point(int x ,int y) : x(x), y(y) {//构造函数 cout << "Constructor called" << endl;.

2020-12-18 09:41:46 352

原创 38.C++动态创建对象

#include <iostream>using namespace std;//通过指针访问类的静态函数成员class Point {public://外部接口 Point() :x(0), y(0) { cout << "Default Constructor called"<<endl; } Point(int x ,int y) : x(x), y(y) {//构造函数 cout << "Constructor called".

2020-12-18 09:41:20 72

原创 37.C++通过指针访问类的静态函数成员

#include <iostream>using namespace std;//通过指针访问类的静态函数成员class Point {public://外部接口 Point(int x = 0, int y = 0) : x(x), y(y) {//构造函数 count++; } Point(const Point& p) :x(p.x), y(p.y) {//复制构造函数 count++; } ~Point() { count--; } int ge.

2020-12-18 09:40:52 432

原创 36.C++通过指针访问类的静态成员

#include <iostream>using namespace std;//通过指针访问类的静态数据成员class Point {public://外部接口 Point(int x = 0, int y = 0) : x(x), y(y) {//构造函数 count++; } Point(const Point& p) :x(p.x), y(p.y) {//复制构造函数 count++; } int getX() const { return x; }.

2020-12-18 09:40:23 337

原创 34.C++对象指针的使用:利用指针访问对象成员

#include <iostream>using namespace std;//对象指针的使用class Point {public://外部接口 Point(int x=0, int y=0) : x(x), y(y) {} int getX() const { return x; }//const 表示该函数不修改bai任何值; int getY() const { return y; }private: int x, y;};int main() {//主函数.

2020-12-17 14:52:27 1124

原创 33.C++函数指针的使用

#include <iostream>using namespace std;//函数指针的使用void printStuff(float) { cout << "This is the print stuff function" << endl;}void printMessage(float data) { cout << "The data to be listed is" << data << endl;.

2020-12-17 14:38:37 109

原创 32.C++用指针作为函数参数分离整数部分和小数部分

#include <iostream>using namespace std;//将实数x分成整数部分和小数部分void spiltFloat(float x, int* intPart, float* fracPart) { *intPart = static_cast<int>(x); *fracPart = x - *intPart;} int main() { cout << "Enter 3 float point number.

2020-12-17 14:18:03 1264

原创 31.C++二维数组和指针数组

#include <iostream>using namespace std;//输出二维数组int main() { int array2[3][3] = { {11,12,13},{21,22,23},{31,32,33} }; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { cout << *(*(array2 + i) + j) << " "; } .

2020-12-17 13:58:13 58

原创 30.C++利用指针数组输出单位矩阵

#include <iostream>using namespace std;//利用指针数组输出单位矩阵int main() { int line1[] = { 1,0,0 }; int line2[] = { 0,1,0 }; int line3[] = { 0,0,1 }; //定义整型指针数组并初始化 int* pLine[3] = { line1,line2,line3 }; cout << "Matrix test:" << endl;.

2020-12-17 13:46:00 876 1

原创 29.C++实现用三种方式输出数组元素

#include <iostream>using namespace std;//使用数组名和下标输入输出数组元素int main() { int a[10] = { 1,2,3,4,5,6,7,8,9,0 }; for (int i=0; i < 10; i++) { cout << a[i] << " "; } cout << endl;//使用数组名和指针运算 for (int i = 0; i < 10; i+.

2020-12-17 12:54:00 2252

原创 28.C++指针的定义赋值和使用

#include <iostream>using namespace std;//指针的定义和使用int main() { int i; int* ptr = &i; i = 10; cout << "i=" << i << endl; cout << "*ptr=" << *ptr << endl; return 0;}

2020-12-17 12:46:33 246

原创 27.C++使用数组名作为函数参数

#include <iostream>#include <string>using namespace std;//使用数组名作为函数参数void rowSum(int a[][4], int nRow) {//计算二维数组a每行元素的值的和,nRow是行数 for (int i = 0; i < nRow; i++) { for (int j = 1; j < 4; j++) a[i][0] = a[i][0] + a[i][j]; }}.

2020-12-17 11:49:15 559

原创 26.C++数组的声明和使用

注意越界问题#include <iostream>#include <string>using namespace std;int main() { int a[10], b[10]; for (int i = 0; i < 10; i++) { a[i] = i * 2 - 1; b[10 - i - 1] = a[i]; } for (int i = 0; i < 10; i++) { cout << "a["<&

2020-12-17 11:31:02 333 1

原创 25.C++指针使用

#include <iostream>#include <string>using namespace std;int main() { int arr[] = { 1,2,3 }; double* p = reinterpret_cast<double*>(&arr[0]); *p = 5;//*p=5则代表这个指针指向的地址为5 cout << arr[0] << " " << arr[1] <&.

2020-12-17 10:56:00 88

ssh_pracice1

用户管理系统demo,自己使用的,初学者自用里面有国际化校验等内容!!!!

2018-04-20

空空如也

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

TA关注的人

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