大萝卜BoBoBoBo~

导航

OJ复习2/Problem A: 平面上的点——Point类 (I)

 

 

#include<iostream>
#include<iomanip>
using namespace std;
class Point
{
  public:
      double x;
      double y;
    Point(){x=0,y=0;}
    Point(double a,double b){x=a; y=b;}
    void show()
    {cout<<"Point : ("<<setprecision(16)<<x<<", "<<setprecision(16)<<y<<")"<<endl;}

};
int main()
{
    char c;
    double a, b;
    Point q;
    while(std::cin>>a>>c>>b)
    {
        Point p(a, b);
        p.show();
    }
    q.show();
}

 

posted on 2020-04-20 21:13  我有一个大萝北  阅读(186)  评论(0编辑  收藏  举报