⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 point.h

📁 《C++程序设计教程(第二版)》源代码 源代码中包括运行所需的数据文件,它的格式是*.txt,还有*.in和*.out的。头文件格式是*.h
💻 H
字号:
//=====================================
// point.h
//=====================================
#ifndef HEADER_POINT
#define HEADER_POINT
//-------------------------------------
#include<iostream>
using namespace std;
//-------------------------------------
class Point{
protected:
  double x, y;
public:
  static double PI;
public:
  Point(double a=0, double b=0);
  double xOffset()const;
  double yOffset()const;
  double angle()const;
  double radius()const;
  Point operator+(const Point& d)const;
  Point& operator+=(const Point& d);
  void moveTo(double a, double b);
friend inline ostream& operator<<(ostream& o, const Point& d){
    return o<<'('<<d.x<<','<<d.y<<')'<<'\n';
}
};//===================================
#endif  // HEADER_POINT

 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -