C++程序设计

[复制链接]
查看11 | 回复0 | 2010-4-28 14:27:58 | 显示全部楼层 |阅读模式
#include#includeusing namespace std;class Point{public: Point(); virtual ~Point(); int PrintCount(); friend float JL(Point &pa, Point &pb);protected:int m_x;
int m_y; int m_count;};Point::Point(){m_count+=1;}Point::~Point(){m_count-=1;}int Point::PrintCount(){return m_count;}float JL(Point &pa, Point &pb){return sqrt((pa.m_x-pb.m_x)*(pa.m_x-pb.m_x)+(pa.m_y-pb.m_y)*(pa.m_y-pb.m_y));}void main(){}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行