05 2011 档案
Directx11 HelloWorld之_一个简洁漂亮的框架
摘要:前些天在看微软的一个HandsOnLab和《IntrotoD3d10》的时候,发现一个挺好的设计框架,简洁优美,很方便初学者搭建自己一些简单的绘制程序,修改下后拿来分享下。关键是Run()和里面的Setup()和MessageLoop()。classBasicDraw{public:HRESULTRun();BasicDraw();~BasicDraw();private:voidInitializeApp();voidCleanUp();HRESULTSetup();HRESULTCreateDisplayWindow();staticLRESULTCALLBACKMyWndProc(HWN
阅读全文
poj2371
摘要:就一个排序,重温了一次快排。#include using namespace std;void Exchange(int arr[],int i,int j){int tmp=arr[i];arr[i]=arr[j];arr[j]=tmp;return;}int Partition(int arr[],int start,int end){int pData=arr[end];int i=start;for(int j=start;j=r)return ;int q=Partition(arr,p,r);QSort(arr,p,q-1);QSort(arr,q+1,r);return ;}in
阅读全文
poj2255
摘要:重构二叉树,已知前序和中序,输出后序。#include #include using namespace std;struct treeNode{treeNode();char letter;treeNode* left;treeNode* right;};treeNode::treeNode(){left=NULL;right=NULL;}void AddNode(treeNode* node,bool left,bool right,char ch){treeNode* tmpNode=new treeNode;tmpNode->letter=ch;if(true==left){no
阅读全文
C++著名程序库的比较和学习经验
摘要:C++著名程序库的比较和学习经验1、C++各大有名库的介绍——C++标准库 2、C++各大有名库的介绍——准标准库Boost 3、C++各大有名库的介绍——GUI 4、C++各大有名库的介绍——网络通信 5、C++各大有名库的介绍——XML6、C++各大有名库的介绍——科学计算 7、C++各大有名库的介绍——游戏开发8、C++各大有名库的介绍——线程9、C++各大有名库的介绍——序列化10、C++各大有名库的介绍——字符串11、C++各大有名库的介绍——综合 12、C++各大有名库的介绍——其他库 13、C++名人的网站 在 C++中,库的地位是非常高的。C++之父 Bjarne Strous
阅读全文
poj3625
摘要:在已有的边上做Prim#include#include#includeusing namespace std;#define infinity 1000000class Point2D{public: double x,y;};Point2D point[1001];double map[1001][1001];double dis[1001];bool flag[1001];int n,m;int main(){ memset(flag,false,sizeof(flag)); int c,i,j,k; double len; double minone; scanf("%d%d&
阅读全文
poj1189
摘要:一道递推#includeusing namespace std;__int64 Gcd(__int64 x,__int64 y){if(x==y)return x;if(x==1||y==1)return 1;__int64 r;if(x<y){r=x;x=y;y=r;}while(y!=0){r=x%y;x=y;y=r;}return x;}int main(){char mark[51][101];__int64 sum[51][101];__int64 finalsum;int i,j;int n,n1,m;int colnum;int spoint;int epoint;int
阅读全文
一个分支限界的旅行商求解
摘要:图论作业,分支限界的旅行商算法。印象和以前写的旅行商分支限界有点不一样,记录下。1:对边的权值排序。2:边入栈(如果满足限界等条件)。3:边退栈(不能再入栈时)。#include #include using namespace std;const int maxNumber=1000000;class Edge{public: int weight; int v1,v2;};bool cmp(Edge e1,Edge e2){ return e1.weight=edgeNum)return; if((edgeNum-k)bestCost)return; while( (countVertex
阅读全文
浙公网安备 33010602011771号