摘要: 先安装Visual C++,再安PlatForm SDK,安装完之后点Visual Studio Registration.Registration之后,就可以编译源程序了,自己编译时,注意它的源代码的后缀名为".cpp",不是".c".否则会产生很多错误.关于第一章中的一些问题,windowsx.h头文件:(全部都是网上查的)http://www.codeproject.com/win32/msgcrackwizard.asp 第一部分:介绍:WINDOWSX.H 头文件为W32SDK的程序员提供方便(工具?)很多初中级程序员用C/C++编写Windw 阅读全文
posted @ 2012-08-04 11:22 open your eyes 阅读(614) 评论(0) 推荐(0) 编辑
摘要: 1.在一个函数声明中,const 可以修饰函数的返回值,或某个参数;对于成员函数,还可以修饰是整个函数。有如下几种情况,以下会逐渐的说明用法:A& operator=(const A& a);void fun0(const A* a );void fun1( ) const; // fun1( ) 为类成员函数const A fun2( );1) 修饰参数的const,如 void fun0(const A* a ); void fun1(const A& a);调用函数的时候,用相应的变量初始化const常量,则在函数体中,按照const所修饰的部分进行常量化,如形参 阅读全文
posted @ 2012-08-01 10:19 open your eyes 阅读(710) 评论(0) 推荐(0) 编辑
摘要: 1.dynamic_cast2.const_cast3.static_cast4.reinterpret_cast 阅读全文
posted @ 2012-05-25 17:40 open your eyes 阅读(121) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>using namespace std;int flag=1;typedef struct node{ int W1,D1,Wr,Dr; struct node *left,*right;}bitnode,*bitree;void createtree(bitree *T){ bitnode bit; cin>>bit.W1>>bit.D1>>bit.Wr>>bit.Dr; *T=new node; (*T)->D1=bit.D1; (*T)-> 阅读全文
posted @ 2012-05-16 00:26 open your eyes 阅读(306) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<cctype>#include<map>#include<cstring>#include<iterator>using namespace std;int main(){ string sa; while(getline(cin,sa)) { cout<<"Expression: "<<sa<<endl; int k,i,j,flag=0,sum=0; string temp=&q 阅读全文
posted @ 2012-05-15 00:16 open your eyes 阅读(184) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cstdlib>#include<string>#include<malloc.h>#include<map>using namespace std;map<int,int>ma;int flagg=0;typedef struct node{ int data; struct node*left; struct node* right; int flag;}bitnode,*bitree;void createbittree(bitree *T,int flag3){ 阅读全文
posted @ 2012-05-14 15:22 open your eyes 阅读(352) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<malloc.h>#include<cstdio>using namespace std;const int maxn=10000+10;int minn,ans=0;typedef struct node{ int data; struct node *left,*right;}bitnode,*bitree;void createtree(bitree *T,int *in,int *post,int len){ int k; int *temp; if(len<=0) { *T=NUL... 阅读全文
posted @ 2012-05-07 20:32 open your eyes 阅读(241) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;int a[100000];int nLeaves;typedef struct treeNode{ int data; treeNode*left,*right; treeNode():data(),left(NULL),right(NULL){} treeNode(int x):data(x),left(NULL),right(NULL){}}treeNode;inline bool isnum(char ch){ return ((ch>='0' && ch&l 阅读全文
posted @ 2012-05-07 14:58 open your eyes 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 还记得vector怎么使用吗?valarray类似vector,也是一个模板类,其主要被用来对一系列元素进行高速的数字计算,其与vector的主要区别在于以下两点 1、valarray定义了一组在两个相同长度和相同类型的valarray类对象之间的数字计算,例如xarr = cos(yarr) + sin(zarr); 2、通过重载operater[],可以返回valarray的相关信息(valarray其中某个元素的引用、特定下标的值或者其某个子集)。如果想对两个vector进行一些运算,如第一个vector的对象元素加上第二个vector的对应元素,还得写个for循环,或调用相应的库函数. 阅读全文
posted @ 2012-05-07 00:07 open your eyes 阅读(2080) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cstring>using namespace std;int main(){ int sum; cin>>sum; while(sum--) { int n,p; cin>>n; cin.ignore(); cin>>p; cin.ignore(); int i,j,a[3660]; memset(a,0,sizeof(a)); int temp,lose=0; for(i=0;i<p;i+... 阅读全文
posted @ 2012-05-06 00:10 open your eyes 阅读(218) 评论(0) 推荐(0) 编辑