摘要: #include<iostream>#include<algorithm>sortusing namespace std;template<class ElemType>class Array{ private: ElemType *elem; int size; public: Array(ElemType a[],int sz):elem(a),size(sz){}; ElemType Max(); ElemType Sum(); void Sort(); void Show();};template <class ElemType>Elem 阅读全文
posted @ 2012-11-22 23:06 ♂咱說 ろ算 阅读(157) 评论(0) 推荐(0) 编辑
摘要: //fraction.h#include"utility.h"#include<iostream.h>class Fraction{private: int nume; int deno; int Gcf(int m,int n);public: Fraction(int n=1,int d=1); virtual ~Fraction(){}; bool dight(char ch); void Reduction(); int GetNume(){return nume;} int GetDeno(){return deno;} void SetNume(in 阅读全文
posted @ 2012-11-22 23:05 ♂咱說 ろ算 阅读(244) 评论(0) 推荐(0) 编辑
摘要: /*设计一个日期类Date,包括年、月、日等私有成员。要求实现日期的基本运算,例如某日期加上天数或减去天数,两日期相减的天数等。实现要求:实现运算符加与减的重载*/#include<iostream>#include<string>#include<iomanip>#include<cmath>using namespace std;class Date{private: int year; int month; int day; static int sumDays;public: int monthDay(int year1,int mont 阅读全文
posted @ 2012-11-22 23:04 ♂咱說 ろ算 阅读(350) 评论(0) 推荐(0) 编辑
摘要: /*能够显示公元后任意年份的日历,日历以月份顺序排列,每月以星期顺序排列,类似于一般挂历上的格式。先以2000年1月1日周六作为推算起点来判定实现指定2000年后的日历再将起点日期改为公元元年一月一日是星期几注意判断闰年、月、周的判别*/#include<iostream>#include<iomanip>#include<cmath>using namespace std;class Date{private: int year;public: int monthDay(int year1,int month1); void setDate(); void 阅读全文
posted @ 2012-11-22 23:02 ♂咱說 ろ算 阅读(232) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<windows.h>using namespace std;typedef char TElemType ;typedef enum PointerTag{Link,Thread};typedef struct BiThrNode{ TElemType data; struct BiThrNode *lchild,*rchild; PointerTag LTag,RTag;}BiThrNode,*BiThrTree;void CreatTree(BiThrTree &T){ TElemType item; c 阅读全文
posted @ 2012-11-22 23:01 ♂咱說 ろ算 阅读(236) 评论(0) 推荐(0) 编辑
摘要: //main.cpp#include<iostream>using namespace std;typedef char TElemType;typedef struct node{ TElemType data; struct node *lchild; struct node *rchild;}BiTNode,*BinTree;BiTNode *creatBinTree(TElemType *VLR,TElemType *LVR,int n)//由中序序列和前序序列构造二叉树{ if(n==0) return NULL; int k=0; while(VLR[0]!=LVR[k 阅读全文
posted @ 2012-11-22 23:00 ♂咱說 ろ算 阅读(359) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>using namespace std;#define maxnum 100#define maxlength 10000typedef int ElemType;typedef int WType;typedef struct{ ElemType tu[maxnum][maxnum]; //邻接矩阵 string point[maxnum]; //顶点矩阵 int point_num; //顶点个数}Graph;void input(Graph &G){ cout<<"请 阅读全文
posted @ 2012-11-22 22:58 ♂咱說 ろ算 阅读(275) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>using namespace std;#define maxnum 100#define maxlength 10000typedef int ElemType;typedef int WType;typedef struct{ ElemType tu[maxnum][maxnum]; //邻接矩阵 string point[maxnum]; //顶点矩阵 int point_num; //顶点个数}Graph;void input(Graph &G){ cout<<"请 阅读全文
posted @ 2012-11-22 22:57 ♂咱說 ろ算 阅读(253) 评论(0) 推荐(0) 编辑
摘要: //graph.h#include<iostream>#include<cstdlib>#include<queue>using namespace std;#define maxVert 20#define maxWeight 10000typedef char VType;typedef double WType;typedef struct{ int numVetr,numEdges;//点和边的个数 VType *VertList;//点矩阵 WType **Edge;//邻接矩阵}Graph;void InitGraph(Graph &G) 阅读全文
posted @ 2012-11-22 22:56 ♂咱說 ろ算 阅读(225) 评论(0) 推荐(0) 编辑
摘要: //迷宫#include<iostream>#include<ctime>#include<windows.h>#include<fstream>using namespace std;struct offsets{ int a,b; char *dir;};struct node{ int x,y;};struct tag{ int x,y; char *dir;};class MiGong{private: int map[30][30];//地图矩阵 int mark[30][30];//标志矩阵 offsets move[4];//各个方 阅读全文
posted @ 2012-11-22 22:55 ♂咱說 ろ算 阅读(192) 评论(0) 推荐(0) 编辑