C Plus Plus
文章平均质量分 82
fool_fool
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
The complex class
// File name : complex.h #ifndef _COMPLEX_H_ #define _COMPLEX_H_ #include using namespace std; class complex { public: complex(double x = 0, double y = 0) { real = x; imag = y; }原创 2013-04-21 16:44:35 · 480 阅读 · 0 评论 -
inheritance and virtual
#ifndef _INHERIENCE_H_ #define _INHERIENCE_H_ #include using namespace std; class vehicle{ private: char* id; double price; char* owner; public: vehicle(char* iden = NULL, double pr原创 2013-05-01 17:29:00 · 719 阅读 · 0 评论 -
Function object
#ifndef _SHAPE_H_ #define _SHAPE_H_ #include using namespace std; class Shape{ public: virtual double area() const = 0; virtual double perimeter() const = 0; }; class Square; class Rect原创 2013-05-05 16:53:39 · 417 阅读 · 0 评论 -
C++ 编程练习1
1. 编写日历打印程序,要求实现如下的main函数: class Calendar; int main() { Calendar c0; Calendar c1(2013); Calendar c2(2013, 4); Calendar c3(2013, 4, 23); cout原创 2013-04-23 13:53:54 · 447 阅读 · 0 评论 -
C++ 编程练习3
C++版Dijkstra最短路径算法 ///////////////////////////////////////////////////////////////////////////////////// //file:ShortestPath.h #ifndef _SHORTESTPATH_H_ #define _SHORTESTPATH_H_ #define MAX_原创 2013-05-15 08:27:22 · 572 阅读 · 0 评论 -
c++编程练习2
1. 给定一个带权(非负)有向图,打印输出从节点S到节点T的最短路径(要求打印最短路径长度和具体的路径) int main() { Graph G; // Graph is a class with template G.build(data.txt); // build the graph Path path; //Path is a class with templa原创 2013-05-06 11:04:42 · 404 阅读 · 0 评论
分享