/* 2. ´ÙÀ½ ÇÁ·Î±×·¥ÀÇ Ãâ·ÂÀ» ½á¶ó. */ #include int number[5] = { 1, 2, 3, 4, 5 }; // ¿©±â¸¦ ¹Ù²Ü °Í class Point3D { public: int x; int y; int z; Point3D(int a,int b,int c) { x = a; y = b; z = c; } void foo(Point3D p) { p.x = p.x+1; p.y = p.y-1; p.z = 0; x++; y--; z = x+y; } void print() { printf("%d %d %d\n",x,y,z); } }; void foo(Point3D p) { p.x = p.y = p.z = 0; } void main() { Point3D x(number[0],number[1],number[2]); Point3D y(number[2],number[3],number[4]); x.foo(y); foo(x); y.foo(x); foo(y); x.print(); y.print(); }