05 2020 档案

摘要:头文件 1 #pragma once 2 #ifndef ZMR_H 3 #define ZMR_H 4 #include <iostream> 5 #include <fstream> 6 using namespace std; 7 const int MAX = 100; 8 enum zon 阅读全文
posted @ 2020-05-31 11:12 幻想Elapse 阅读(148) 评论(0) 推荐(0) 编辑
摘要:1 DATA SEGMENT 2 BUF DB 0,0,0,0,0,0,0,0,0 3 BUFSIZE = $-BUF-1 4 FLAG DB 0 ;是否完成排序的标志 5 F_INSERT DB 0 6 CR DB 0AH,0DH,'$' 7 DATA ENDS 8 STACK SEGMENT 9 阅读全文
posted @ 2020-05-30 11:43 幻想Elapse 阅读(542) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 bool is_leap(int year)//判断闰年 3 { 4 if (year % 100 == 0) 5 { 6 if (year % 400 == 0) 7 return true; 8 else 9 return false; 10 } 阅读全文
posted @ 2020-05-30 11:38 幻想Elapse 阅读(134) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 struct node 5 { 6 char c; 7 int n; 8 int level; 9 struct node* lc; 10 struct node* r 阅读全文
posted @ 2020-05-26 21:05 幻想Elapse 阅读(324) 评论(0) 推荐(0) 编辑
摘要:1 #include<iostream> 2 using namespace std; 3 void bfs(int i1, int j1, int i2, int j2); 4 void deep(int i1, int j1,int i2,int j2); 5 bool dfs(int i, i 阅读全文
posted @ 2020-05-25 16:57 幻想Elapse 阅读(93) 评论(0) 推荐(0) 编辑
摘要:1 //加法器,若要变为减法器,只需改动相应的判断条件即可 2 #include <iostream> 3 using namespace std; 4 struct num//储存多位的整形数字 5 { 6 char input[102]; 7 char sign; 8 char data[101 阅读全文
posted @ 2020-05-25 00:08 幻想Elapse 阅读(193) 评论(0) 推荐(0) 编辑
摘要:1. 即数组的数组 2. 多维数组定义 ap是数组指针 3. ap指向第二个数组 等同于: 4. 指针数组 5. 利用typedef定义数组指针类型 6. 用指针和typedef输出二维数组 7. 不使用typedef 阅读全文
posted @ 2020-05-24 12:18 幻想Elapse 阅读(127) 评论(0) 推荐(0) 编辑
摘要:参考链接:https://blog.csdn.net/xiaofan086/article/details/8494828 debug命令:https://wenku.baidu.com/view/6431b9e5524de518964b7df6.html 准备好这三个文件,放在MASM文件夹里,这 阅读全文
posted @ 2020-05-20 18:04 幻想Elapse 阅读(378) 评论(0) 推荐(0) 编辑
摘要:1. 2. 3. const对象的动态数组 4. 创建长度为0的动态数组是合法的,但不能对返回的指针进行解引用 该指针加减0,或减去本身,得0 5. delete [] array;//回收array所指向的数组 6. string类程序比C风格字符串执行得快 7. c_str() 8. 用数组类型 阅读全文
posted @ 2020-05-19 19:40 幻想Elapse 阅读(140) 评论(0) 推荐(0) 编辑
摘要:1. 字符串字面值的类型是cosnt char类型的数组 2. strncat和strncpy 阅读全文
posted @ 2020-05-19 18:57 幻想Elapse 阅读(163) 评论(0) 推荐(0) 编辑
摘要:1. 定义:string *pstring;//强调pstring是一个指针 而非:string* pstring;//容易被误解为string*是一种类型,当string* str1,str2时,str2可能被认为是一个指针,其实它是一个string对象 2. 将指针初始化为0,编译器可以检测出零 阅读全文
posted @ 2020-05-18 18:32 幻想Elapse 阅读(118) 评论(0) 推荐(0) 编辑
摘要:1. 非const变量与要在运行阶段才知道其值的const变量(如const unsigned sz = get_size(); ,需要运行时调用函数 )才能作为数组维数 2. const a = 20; int b[a+1]; //合法,因为在编译时可以知道a+1的值为21 3. 函数体内,加{} 阅读全文
posted @ 2020-05-16 23:06 幻想Elapse 阅读(116) 评论(0) 推荐(0) 编辑
摘要:1. bitset<10> a;//a有10位,每位是0 bitset<10> a1(a);//a1是a的一个副本 bitset<16> b(0xffff);//b有16位,每位是1 bitset<32> c(0xffff);//c有16位,0-15是1,16-31是0 //初始化长度超过bitse 阅读全文
posted @ 2020-05-16 12:50 幻想Elapse 阅读(133) 评论(0) 推荐(0) 编辑
摘要:1. 容器的bengin()指代第一个元素,end()不指向任何元素,只起哨兵作用,表示已经处理完vector中的所有元素 iterator解引用:*it 2. iterator的自增:向前移动 由于end()不指向任何元素,不能对其使用解引用或者自增操作 3. 用iterator遍历vector 阅读全文
posted @ 2020-05-08 15:54 幻想Elapse 阅读(131) 评论(0) 推荐(0) 编辑
摘要:1. vector初始化: s2为s1副本: n个相同元素: 值初始化: 用一个由库生成的初始值初始化元素,具体值取决于元素类型 可见string类型是初始化为空串,int类型初始化为0 显然:空间在初始化时已经申请 2. 二维vector:> >有空格 s含三个元素,每个元素是大小为4的vecto 阅读全文
posted @ 2020-05-08 12:41 幻想Elapse 阅读(129) 评论(0) 推荐(0) 编辑
摘要:1. string类型初始化: string s3;//s3为空串 2.getline() getline(string,n); 开头不忽略换行符,不忽略空格,而cin会,返回时忽略换行符 。 3. s.size() 算上空格 4. s.empty(); 5. size == 0 ->empty() 阅读全文
posted @ 2020-05-07 20:31 幻想Elapse 阅读(150) 评论(0) 推荐(0) 编辑
摘要:1. 声明:extern i; 2. 将循环边界用一个变量标志,方便修改,使用const限定符, const int buf_size = 100; 3. const定义的变量默认是局部变量,不能被其他文件访问, 如有需要,extern const int i; 非const 变量默认为extern 阅读全文
posted @ 2020-05-07 19:07 幻想Elapse 阅读(535) 评论(0) 推荐(0) 编辑
摘要:1.多项式为0,直接输出0 2.系数为0的项不输出 3.注意double类型的判0 1 #include <iostream> 2 #include <vector> 3 #include <iomanip> 4 #include <cmath> 5 using namespace std; 6 7 阅读全文
posted @ 2020-05-06 09:56 幻想Elapse 阅读(131) 评论(0) 推荐(0) 编辑
摘要:思路: 1.如果是负的先输出'-',再转换为正数。 2.如果是0,直接输出。 3.以999991为例,先%10,得1,将1存入容器,总数-1(为999990);再%100,得90,除以(100/10),得9,将9存入容器,总数-90(为999900);再%1000,得900,除以(1000/10)得 阅读全文
posted @ 2020-05-05 17:15 幻想Elapse 阅读(128) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include <vector> 3 using namespace std; 4 5 int main() 6 { 7 int N; 8 cin >> N; 9 vector<int> s1, s2, s3; 10 for (int i = 0; 阅读全文
posted @ 2020-05-04 17:43 幻想Elapse 阅读(289) 评论(0) 推荐(0) 编辑
摘要:最后一个测试点超时 1 #include <iostream> 2 #include <vector> 3 #include <string> 4 using namespace std; 5 int main() 6 { 7 vector<int>l1, l2, l3; 8 while (1) 9 阅读全文
posted @ 2020-05-04 17:11 幻想Elapse 阅读(519) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 using namespace std; 3 typedef struct node 4 { 5 int id; 6 struct node* next; 7 }*L; 8 int main() 9 { 10 L l1=NULL, l2=NULL, l 阅读全文
posted @ 2020-05-04 16:07 幻想Elapse 阅读(428) 评论(0) 推荐(0) 编辑
摘要:31分代码,还有最后一个测试点没过 1 #include<iostream> 2 #include <map> 3 using namespace std; 4 #define infinite 100000000 5 int main() 6 { 7 int built[101][101]; 8 阅读全文
posted @ 2020-05-04 16:06 幻想Elapse 阅读(328) 评论(0) 推荐(0) 编辑
摘要:最后一个测试点有几率不超时 1 #include <iostream> 2 #include <string> 3 #include <map> 4 #include <vector> 5 #include <algorithm> 6 using namespace std; 7 int main( 阅读全文
posted @ 2020-05-04 09:54 幻想Elapse 阅读(226) 评论(0) 推荐(0) 编辑
摘要:1 #include <iostream> 2 #include<iomanip> 3 #include <map> 4 #include <string> 5 #include <cstring> 6 #include <queue> 7 #include <vector> 8 using nam 阅读全文
posted @ 2020-05-03 23:37 幻想Elapse 阅读(273) 评论(0) 推荐(0) 编辑
摘要:先将所有学生的信息按姓名字典序排序,再根据每个学生选的课程号码分别放入相应链表存储,最后输出每个链表的信息。 1 /*每个课程当做一个桶,桶里面用链表按学生姓名字典序存储学生,最后直接输出每个桶的内容,排序的时候使用头插法*/ 2 #include<iostream> 3 #include <map 阅读全文
posted @ 2020-05-02 21:13 幻想Elapse 阅读(359) 评论(0) 推荐(0) 编辑
摘要:1 #include<iostream> 2 #include <map> 3 #include <string> 4 #include <cstring> 5 using namespace std; 6 map<string, long long int> num;//某话题出现次数 7 int 阅读全文
posted @ 2020-05-02 17:25 幻想Elapse 阅读(312) 评论(1) 推荐(0) 编辑