摘要: 1 #include <ctime> 2 #include <iostream> 3 using namespace std; 4 5 template <class Type> 6 void Swap(Type &x,Type &y); 7 8 inline int Random(int x, i 阅读全文
posted @ 2019-02-26 00:30 ChaosBlog 阅读(5022) 评论(2) 推荐(1)
摘要: 说在前面 本文讲解清晰,从0开始 如不能用Navicat等数据库软件远程登陆,请先检查:安全>防火墙中 是否添加了MYSQL的3306端口(ECS服务器请检查 安全组)如未添加,先点右上角“添加规则”。(在这上面耗了很久- -) 常用的命令: 切换到root管理员账号: 获取Mysql数据库登陆密码 阅读全文
posted @ 2019-02-25 21:28 ChaosBlog 阅读(4228) 评论(1) 推荐(3)
摘要: 文件打开 fopen() 返回FILE* 对象,如果打开失败返回NULL,错误代码存入errno中 申明FILE* stream_1,stream_2 //两个文件流 //注明: ”r+”打开读写文件。”r”打开只读文件。//文件必须存在 “w+”打开读写文件。”w”打开只写文件。//文件不存在自动 阅读全文
posted @ 2018-08-28 13:13 ChaosBlog 阅读(174) 评论(0) 推荐(0)
摘要: 动态分配和释放存储单元 malloc(size):内存动态存储空间中分配长度为size的连续空间(单位是Byte字节),返回起始地址,注意类型强制转换【int* p; p=(int*)malloc(size);】【p本身返回void】 calloc(n,size):内存动态存储区中分配n个长度为si 阅读全文
posted @ 2018-08-28 12:00 ChaosBlog 阅读(237) 评论(0) 推荐(0)
摘要: 结构体 struct node { int data; char sex; }s1,s2; // 变量s1,s2 typedef struct node { int data; char sex; }SS; // 类型名SS typedef 存在类型名 自定义类型名 结构体指针 typedef st 阅读全文
posted @ 2018-08-28 11:57 ChaosBlog 阅读(1082) 评论(0) 推荐(0)
摘要: 1 #include"iostream.h" 2 void Merge(int c[],int d[],int l,int m,int r){ 3 int i=l,j=m+1,k=l; 4 while((i<=m)&&(j<=r)){//循环两组中较小者先放入d[]暂存 5 if(c[i]<=c[j 阅读全文
posted @ 2017-10-26 01:32 ChaosBlog 阅读(1119) 评论(0) 推荐(0)
摘要: 1 #include"iostream.h" 2 3 int BinarySearch(int a[],int left,int right,const int& x) 4 { 5 if(left<right) 6 { 7 int middle = (left+right)/2; 8 if(x==a 阅读全文
posted @ 2017-10-22 17:16 ChaosBlog 阅读(646) 评论(0) 推荐(0)
摘要: 一、查找方法 顺序查找 折半查找 二叉排序树查找 哈希查找 二、排序方法 直接插入排序 冒泡排序 快速排序 简单选择排序 堆排序 归并排序 基数排序 阅读全文
posted @ 2017-10-22 16:12 ChaosBlog 阅读(167) 评论(0) 推荐(0)