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 }

 

posted @ 2013-11-02 15:08  Talbot3  阅读(160)  评论(0编辑  收藏  举报