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(); }