摘要: http://poj.org/problem?id=1077 Source Code Problem: 1077 User: p_hoenix Memory: 220K Time: 0MS Language: C++ Result: Accepted Source Code #include #include #include #include #include u... 阅读全文
posted @ 2011-01-16 21:29 Cranny 阅读(553) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1077 /* procedure dfs(depth:longint); begin if 要剪枝 then exit; if 可行 then Print; if Depth #include using namespace std; struct Status { int board[3][3]; int... 阅读全文
posted @ 2011-01-16 02:13 Cranny 阅读(2213) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1664 //整数划分问题 #include using namespace std; /* f(n,m)表示将正整数n划分成若干个不大于m的整数的和的分法 f(n,m) = 1 n = 1 || m = 1 f(n,n) n m > 1 */ int f(int n, int m) { if(n ==... 阅读全文
posted @ 2011-01-15 13:54 Cranny 阅读(262) 评论(0) 推荐(0) 编辑
摘要: //http://poj.org/problem?id=2449 #include #include #include #include using namespace std; typedef pair pii;//距离,顶点 struct Arc { int vex; int weight; }; const int MAX_VEX_NUM = 1010; const ... 阅读全文
posted @ 2011-01-14 17:57 Cranny 阅读(292) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; class Screen; class ScreenPtr; class Screen { public: typedef string::size_type index; Screen(int r = 4, int c = 3) { contents.resize(r * c, '#'); he... 阅读全文
posted @ 2011-01-13 20:24 Cranny 阅读(251) 评论(0) 推荐(0) 编辑
摘要: //MFC.h #define BOOL int #define TRUE 1 #define FALSE 0 #include using namespace std; class CObject { public: CObject(){}; ~CObject(){}; }; class CCmdTarget : public CObject { public: CCmdTa... 阅读全文
posted @ 2011-01-03 20:14 Cranny 阅读(613) 评论(0) 推荐(0) 编辑
摘要: //MFC.h #include using namespace std; class CObject { public: CObject() { cout #include "MFC.h" using namespace std; class CMyWinApp : public CWinApp { public: CMyWinApp() { cout<<"CMyWinA... 阅读全文
posted @ 2011-01-03 20:10 Cranny 阅读(279) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; class ClassA { public: int m_data1; int m_data2; void func1(){} void func2(){} virtual void vfunc1(){} virtual void vfunc2(){} }; class ClassB : public Clas... 阅读全文
posted @ 2011-01-03 20:06 Cranny 阅读(165) 评论(0) 推荐(0) 编辑
摘要: #include #include #define SA (1 = 126) { step = 0; } //i2c读写之间需要一点时间间隔 write_byte(10,step); } delay_music(10); } } void delay() { _nop_(); _nop_(); _nop_(); _nop_(); ... 阅读全文
posted @ 2010-12-13 21:31 Cranny 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 向量(Vector)在几乎所有的几何问题中,向量(有时也称矢量)是一个基本点。向量的定义包含方向和一个数(长度)。在二维空间中,一个向量可以用一对x和y来表示。例如由点(1,3)到(5,1的向量可以用(4,-2)来表示。这里大家要特别注意,我这样说并不代表向量定义了起点和终点。向量仅仅定义方向和长度。向量加法向量也支持各种数学运算。最简单的就是加法。我们可以对两个向量相加,得到的仍然是一个向量。我... 阅读全文
posted @ 2010-11-08 09:39 Cranny 阅读(796) 评论(0) 推荐(0) 编辑