码迷,mamicode.com
首页 >  
搜索关键字:cpp    ( 13186个结果
类族的设计
1.点线型: /* *Copyright (c)2015,烟台大学计算机与控制工程学院 *All rights reserved. *文件名称:sum123.cpp *作 者:林海云 *完成日期:2015年5月29日 *版 本 号:v2.0 * *问题描述:先建立一个Point(点)类,包含数据成员x,y(坐标点),实现需要的成员函数,并设计main函数完成测试 *程序输入:无 *程序输出...
分类:其他好文   时间:2015-05-30 09:26:26    阅读次数:95
点类派生直线类
输入代码: /* *Copyright (c)2015,烟台大学计算机与控制工程学院 *All rights reserved. *文件名称:sum123.cpp *作 者:林海云 *完成日期:2015年5月29日 *版 本 号:v2.0 * *问题描述:定义点类Point,并以点类为基类,派生出直线类Line,从基类中继承的点的信息表示直线的中点。 请阅读下面的代码...
分类:其他好文   时间:2015-05-30 09:25:57    阅读次数:101
【Best Time to Buy and Sell Stock】cpp
题目:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ...
分类:其他好文   时间:2015-05-30 09:14:38    阅读次数:135
POJ 3692 最大团
最大团=补图最大独立集 when 补图是二分图时, 最大团=补图顶点数-最大匹配 // // main.cpp // poj3692 // // Created by Fangpin on 15/5/29. // Copyright (c) 2015年 FangPin. All rights reserved. // #include #include #include usi...
分类:其他好文   时间:2015-05-29 23:21:08    阅读次数:317
第12周上机实践项目4——点、园的关系(1)
(1)先建立一个Point(点)类,包含数据成员x,y(坐标点); (2)以Point为基类,派生出一个Circle(圆)类,增加数据成员(半径),基类的成员表示圆心; (3)编写上述两类中的构造、析构函数及必要运算符重载函数(本项目主要是输入输出); (4)定义友元函数int locate,判断点p与圆的位置关系(返回值0 圆外); 代码 #include #include ...
分类:其他好文   时间:2015-05-29 23:18:36    阅读次数:177
hdu 3829 二分图最大独立集
将孩子看做点,两个孩子间存在矛盾关系则连一条边,最后求二分图最大独立集即可// // main.cpp // hdu3829 // // Created by Fangpin on 15/5/29. // Copyright (c) 2015年 FangPin. All rights reserved. // #include #include #include #include ...
分类:其他好文   时间:2015-05-29 23:18:21    阅读次数:145
第12周上机实践项目4——点、圆的关系(2)
(5)在圆类上重载关系运算符(6种),使之能够按圆的面积比较两个圆的大小。自编main函数完成测试 代码 #include #include using namespace std; class Point { protected: double x,y; public: Point(double xx,double yy):x(xx),y(yy) {} d...
分类:其他好文   时间:2015-05-29 23:17:11    阅读次数:130
【Jump Game II 】cpp
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your max...
分类:其他好文   时间:2015-05-29 23:04:22    阅读次数:183
我的Cocos2d-x学习笔记(九)游戏帧循环(游戏主循环)
游戏运行时候会不断按照游戏逻辑规则重新绘图,反复处理用户输入、处理定时事件、绘图,直到游戏结束。 Cocos2d-x引擎也是通过不断绘图来进行游戏的,默认的帧率在AppDelegate.cpp中显示为60帧每秒,也就是每秒执行了60次用户输入、定时时间、绘图等。抄录Cocos2d-x高级教...
分类:其他好文   时间:2015-05-29 21:37:55    阅读次数:258
【Jump Game】cpp
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your max...
分类:其他好文   时间:2015-05-29 21:31:57    阅读次数:126
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!