
C++课程设计
JPDAYSUNDAY
这个作者很懒,什么都没留下…
展开
-
c++实现重载分数的四则运算
#includeusing namespace std;class Point{private: int c_point; int m_point; char code;public: Point() { code='/'; } Point(int n1,int n2) { c_point=n1; m_point=n2;原创 2012-12-12 15:27:48 · 2550 阅读 · 0 评论 -
c++实现万年历,从公元1年1月1日开始,这一天是星期一
//从公元元年一月一日是星期一开始计算//用类实现求万年历的算法#include#include#includeusing namespace std;class Calendar{private: int month; int date; string Day[7];//char Day[7][10];//私有成员不能初始化,而且字符数组要想原创 2012-10-23 22:18:08 · 5689 阅读 · 1 评论 -
色子游戏(随机数)
//不用随机数/*#include#include#define TRUE 1#define ERROR 0using namespace std;int Game1() //第一次投掷骰子的方法规则{ int n1,n2; cout cin>>n1>>n2; int s1=n1+n2; if((s1==7)||(s1==11)) return原创 2012-10-12 20:35:52 · 992 阅读 · 0 评论 -
循环链表实现删除数据 小孩转圈淘汰游戏(循环链表实现)
因为我使用了分开写的文件,把类的声明放在了头文件中,下面是类的定义#include#include"Cycling_Link.h"using namespace std;#define TRUE 1#define ERROR 0int Link::Initlist(){ head=new Data; if(NULL==head)return ERROR; hea原创 2012-11-07 23:52:37 · 3281 阅读 · 0 评论 -
c++课程设计 对日期的基本运算 使用重载
#include#include#include#define error 0using namespace std;class Calendar{private: int month; int date; string Day[7];//char Day[7][10];//私有成员不能初始化,而且字符数组要想赋值,要么就一个一个的赋值 int原创 2012-12-06 22:48:05 · 1209 阅读 · 0 评论 -
c++课程设计 对日期及时间的基本运算(时间类和日期类) 使用重载
#include#include#define error 0using namespace std;class Time{private: int hour; int minute; //int second;public: Time(int h,int m) { hour=h; minute=m; //second=s;原创 2012-12-06 22:50:59 · 2837 阅读 · 0 评论 -
设置未来时间,并通过倒计时显示器的界面显示
#include#include#include#define error 0using namespace std;class Time{private: int hour; int minute; int second;public: Time(int h,int m) { hour=h; minute=m; secon原创 2012-12-06 22:53:11 · 1681 阅读 · 0 评论 -
c++自动获取当前时间,并分别用整形输出
#include #include using namespace std;int main(){ time_t now; struct tm *fmt; time(&now); fmt = localtime(&now); couttm_year+1900tm_mon+1tm_mday<<" "; couttm_hourtm_mintm_sec原创 2012-12-07 09:05:27 · 1859 阅读 · 0 评论 -
小孩转圈淘汰游戏(数组实现)Jose类,Ring类
#includeusing namespace std;#define TRUE 1#define ERROR 0class Array{private: int *array; int length;public: void Initlist(int n); void Destorylist(); void output(); int Li原创 2012-12-06 22:56:08 · 1053 阅读 · 0 评论 -
C++实现汽车订票系统(C++课程设计)
#include#include#include#include#define Maxsize 100using namespace std;struct Route{ char number[20]; char startandreach[20]; char type[20]; char longroute[20]; char time[20]原创 2012-12-12 15:45:54 · 6033 阅读 · 3 评论