5-5

 1 #include <iostream>
 2 
 3 using namespace std;
 4 
 5 class A
 6 {
 7 private:
 8     int x,y;
 9 public:
10     A(int i,int j):x(i),y(j){}
11     void Adisplay() const
12     {
13         cout<<"x="<<x<<" "<<"y="<<y<<endl;
14     }
15 };
16 
17 int main()
18 {
19     const A a(5,4);
20     a.Adisplay();
21     return 0;
22 }
原文地址:https://www.cnblogs.com/orangebook/p/3403769.html