Definition of sdut 2-1 Point class
2-1 Point class definition Time Limit: 1000 MS Memory limit: 65536 K Description
You can use this exercise to understand the definition of classes and objects;
Design a point class Time, which has private data members x (x coordinate), y (y coordinate); Public member function: SetPoint (int, int) is used to set the value of the point object, showPoint () is used to output the information of a vertex object.
In the main function, call the member function SetPoint (int, int) to set the value for the vertex object, and call the member function ShowPoint () to output the vertex information.
Input does not output a pair of parentheses, and the values of x and y are separated by commas (,).
None
Sample output
(10, 11)
# Include
Using namespace std; // declare class type class time {// define private part private: int x; int y; // define public part public: void setpoint () // assign the member function {x = 10; y = 11;} void showpoint () // output the member function {cout <"(" <