摘要: 错题,知识盲点、查漏补缺好题,开阔思路、锻炼思维ch7 指针与引用1.传递动态内存 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 void GetMemory(char *p,int num){ 8 ... 阅读全文
posted @ 2015-04-11 19:55 Qin&Yang 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 题目:It is necessary to arrange numbers from 0 to 2^(N+M)-1 in the matrix with 2^N rows and 2^M columns. Moreover, numbers occupying two adjacent cells ... 阅读全文
posted @ 2015-04-11 12:43 Qin&Yang 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 要注意,先关闭Nginx再添加第三方的模块,负责会编译不进去,我被这个地方坑了好久。关闭命令:/usr/local/nginx/sbin/nginx -s quit然后才是:./configure --prefix=/usr/local/nginx --add-module=/root/coding... 阅读全文
posted @ 2015-04-11 10:22 Qin&Yang 阅读(1258) 评论(0) 推荐(0) 编辑
摘要: 1.安装gcc,gcc-c++以及pcre库zlib库Openssl库。2.内核参数的优化,修改/etc/sysctl.conffs.file-max = 999999net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_keepalive_time = 600net.ipv4... 阅读全文
posted @ 2015-04-11 10:16 Qin&Yang 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 问题描述:N皇后问题或者如下皇后变体问题:在一个6*6的棋盘里放置4个互不攻击的车的方案数为多少?(阿里2016实习生在线笔试题)#include#include#include#include#includeusing namespace std;int n,m,goal;int ans,sum;... 阅读全文
posted @ 2015-04-09 17:48 Qin&Yang 阅读(357) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int a[1000]; int waiting = 1; int main(){ int temp = 0; int i = 0; while(cin>>temp){ a[temp] = 1; if(temp == waiting){ cout<<waiting; for(i = waiting ... 阅读全文
posted @ 2015-04-02 22:06 Qin&Yang 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 错题,知识盲点、查漏补缺好题,开阔思路、锻炼思维ch6 预处理、const与sizeof1.#includeusing namespace std;#define SUB(x,y) (x-y) //如果是#define SUB(x,y) x-y,DEV-cpp编译会出错。#define ACCESS... 阅读全文
posted @ 2015-03-28 13:04 Qin&Yang 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 错题,知识盲点、查漏补缺好题,开阔思路、锻炼思维ch51.#includeusing namespace std;int i = 1;int main(){ int i = i; coutusing namespace std;int func(int x){ int count = 0; wh... 阅读全文
posted @ 2015-03-27 14:47 Qin&Yang 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 成员初始化列表的一些注意事项:1.必须在构造函数后面2.const 数据成员必须用成员初始化列表3.引用成员必须用成员初始化列表2和3是因为const与引用都是必须在创建的时候进行初始化。引用成员的应用场景:现在有三个类,如果想在其中两个类中共享第三个类的信息,可以在两个类中分别定义一个引用类型的成... 阅读全文
posted @ 2015-03-22 10:49 Qin&Yang 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 相同点:1.指针与引用都是地址的概念。指针指向一块内存,指针的内容是所指向内存的地址;而引用则是某块内存的别名。2.引用在语言内部用指针实现。3.一般把引用理解为指针,不会犯严重语义错误。引用操作可以看做是受限的指针(仅允许取内容操作)。不同点:1.指针逻辑上是独立的,可以改变指针的内容,也可以改变... 阅读全文
posted @ 2015-03-22 09:06 Qin&Yang 阅读(206) 评论(0) 推荐(0) 编辑