随笔分类 - c/c++
摘要:帮同学写的八数码,启发式搜索 创建两个表open,close,分别用的stl中的优先队列priority_queue和map,好久没写过代码了,bug调了半天
阅读全文
摘要:1 #include 2 #include 3 using namespace std; 4 typedef struct node 5 { 6 int date ; 7 node *pri; 8 node *next; 9 }*linklist,listnode;10...
阅读全文
摘要:#include #include #include using namespace std;typedef int datetype;typedef struct node{ datetype date; struct node* next;}listnode,*linklist;l...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 struct node{ 11 in...
阅读全文
摘要:1、stackstack 模板类的定义在头文件中。stack 模板类需要两个模板参数,一个是元素类型,一个容器类型,但只有元素类型是必要的,在不指定容器类型时,默认的容器类型为deque。定义stack 对象的示例代码如下:stack s1;stack s2;stack 的基本操作有:入栈,如例:s...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 cout ::max)();11 cout ::min)() ::max)();14 cout ::min)() :...
阅读全文
摘要:1 #include 2 int gcd(int a,int b) 3 { 4 int t,max,min; 5 if(a>b) 6 { 7 max=a; 8 min=b; 9 }10 else11 {12 ...
阅读全文
摘要:1 #include 2 #include 3 typedef struct stack 4 { 5 char date; 6 struct stack *next; 7 }stacknode; 8 9 typedef struct10 {11 stacknode *to...
阅读全文
摘要:1 #include 2 #include 3 typedef char datetype;/*定义新的数据类型名*/ 4 typedef struct node 5 { 6 datetype date; 7 struct node *next; 8 }listnode; 9 ty...
阅读全文

浙公网安备 33010602011771号