c++上机作业实验3.1

c++上机作业实验3.1坐标 include iostream 1 using namespace std class Coordinate public Coordinate times 2 cout lt lt Coordinate construction called lt lt endl iostream

大家好,我是讯享网,很高兴认识大家。

坐标

#include<iostream>//1
using namespace std;
class Coordinate {
public:
   Coordinate()
   {
       times = 2;
       cout << "Coordinate construction1 called!" << endl;
   }
   Coordinate(int times1)
   {
       times = times1;
       cout << "Coordinate construction2 called!" << endl;
   }
   ~Coordinate()
   {
       cout << "Coordinate destruction called!" << endl;
   }

  void InputCoord()
   {
       for (int i = 0; i < times; i++)
       {
           cout << "Please Input x:" << endl;
           cin >> Coord[i][1];
           cout << "Please Input y:" << endl;
           cin >> Coord[i][2];
       }
   }<

小讯
上一篇 2025-03-29 17:14
下一篇 2025-03-04 13:48

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/117092.html