没有合适的资源?快使用搜索试试~ 我知道了~
图形变换(数据结构课程设计)
2星 需积分: 9 3 下载量 45 浏览量
2010-01-08
14:18:33
上传
评论
收藏 6KB TXT 举报
温馨提示
试读
10页
使用于数据结构课程设计,很好,很强大~~~~ 图形变换问题。
资源推荐
资源详情
资源评论
#include<iostream>
using namespace std;
#define zuida 0x10000
#define PQueue 10000
char next;
int a=0,b=0;
short x[zuida],y[zuida];//记录变换
int get[28][2];//使用数组形成队列
//异常处理
#include <Exception>
template <class SZ>
class Linked_Queue;
template <typename SZ>
class Point
{
friend class Linked_Queue<SZ>; //使用前LinkedQueue必须先声明
private:
SZ data;
Point<SZ> *link;
};
template <class SZ>
class Linked_Queue
{
// FIFO对象
public:
Linked_Queue() {front = rear = 0;} // 构造函数
~Linked_Queue(); // 析构函数
bool Is_Empty() const
{return ((front) ? false : true);}
using namespace std;
#define zuida 0x10000
#define PQueue 10000
char next;
int a=0,b=0;
short x[zuida],y[zuida];//记录变换
int get[28][2];//使用数组形成队列
//异常处理
#include <Exception>
template <class SZ>
class Linked_Queue;
template <typename SZ>
class Point
{
friend class Linked_Queue<SZ>; //使用前LinkedQueue必须先声明
private:
SZ data;
Point<SZ> *link;
};
template <class SZ>
class Linked_Queue
{
// FIFO对象
public:
Linked_Queue() {front = rear = 0;} // 构造函数
~Linked_Queue(); // 析构函数
bool Is_Empty() const
{return ((front) ? false : true);}
bool Is_Full() const;
SZ First() const; // 返回第一个元素
SZ Last() const; // 返回最后一个元素
Linked_Queue<SZ>& Add(const SZ& x);
Linked_Queue<SZ>& Delete(SZ& x);
//自定义的异常处理类
public:
class NoMem:public std::exception
{
public:
virtual const char* what() const throw()
{
return "OUT OF MEMORY!";
}
};
class OutOfBounds:public std::exception
{
public:
virtual const char* what() const throw()
{
return "OUT OF BOUND!";
}
};
private:
Point<SZ> *front; // 指向第一个节点
Point<SZ> *rear; //指向最后一个节点
};
template <class SZ>
Linked_Queue<SZ>:: ~Linked_Queue()
SZ First() const; // 返回第一个元素
SZ Last() const; // 返回最后一个元素
Linked_Queue<SZ>& Add(const SZ& x);
Linked_Queue<SZ>& Delete(SZ& x);
//自定义的异常处理类
public:
class NoMem:public std::exception
{
public:
virtual const char* what() const throw()
{
return "OUT OF MEMORY!";
}
};
class OutOfBounds:public std::exception
{
public:
virtual const char* what() const throw()
{
return "OUT OF BOUND!";
}
};
private:
Point<SZ> *front; // 指向第一个节点
Point<SZ> *rear; //指向最后一个节点
};
template <class SZ>
Linked_Queue<SZ>:: ~Linked_Queue()
剩余9页未读,继续阅读
资源评论
- tpx5202012-03-30就给了一个txt文件,里面一些代码,不是什么课程设计啊,不是我想要的
- bluedream282012-08-15只有部份代码,帮助不是很大。
bbyf920
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功