摘要: N皇后问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3860 Accepted Submission(s): 1801... 阅读全文
posted @ 2012-11-18 21:47 N3verL4nd 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 7.1.1 简单枚举 #include #include #include using namespace std;int main(){ //freopen("out.txt","w",stdout); int num1[50] = {0}; int num2[50] = {0}; int n... 阅读全文
posted @ 2012-11-18 21:20 N3verL4nd 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 还是找你帮我编个程序,我最近用脑过度- - 输入一串字符,以“?”结束,统计各字母出现的次数,并按字母出现的多少输出 先输出字母出现多的,次数相同的按照字母表顺序输出,不出现的不输出 主要是后面那句的- -要求 #include#include#includetypedef struc... 阅读全文
posted @ 2012-11-18 15:53 N3verL4nd 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 在c++中时不能像java中一样定义这样的数组 int[] arr = new int[],如果我们要根据程序的运行来实现动态数组在c++中利用指针这个好东东。 动态一维数组: #includeusing namespace std;int main(){ int len; c... 阅读全文
posted @ 2012-11-18 10:27 N3verL4nd 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 堆:顺序随意 栈:先进后出 堆和栈的区别 一、预备知识—程序的内存分配 一个由c/C++编译的程序占用的内存分为以下几个部分 1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈 2、堆区(heap) — 一般由程序员分配释放, 若程... 阅读全文
posted @ 2012-11-18 10:26 N3verL4nd 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 也许很多C++的初学者都知道什么是构造函数,但是对复制构造函数(copy constructor)却还很陌生。对于我来说,在写代码的时候能用得上复制构造函数的机会并不多,不过这并不说明复制构造函数没什么用,其实复制构造函数能解决一些我们常常会忽略的问题。 为了说明复制构造函数作... 阅读全文
posted @ 2012-11-18 10:23 N3verL4nd 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Every object in C++ has access to its own address through an important pointer calledthis pointer. The this pointer is an implicit parameter to al... 阅读全文
posted @ 2012-11-18 10:23 N3verL4nd 阅读(176) 评论(0) 推荐(0) 编辑