720.cpp

来自「C++实训教程」· C++ 代码 · 共 27 行

CPP
27 行
字号
//720.cpp
#include <iostream.h>
class Point
{
  public:
	int x,y,z;	// 3_d coordinates
	Point(int a,int b,int c)
	{	x=a;		y=b;		z=c;	}
};
ostream& operator << (ostream& is,Point p)
{
     is << p.x << " , ";
     is << p.y << " , ";
     is << p.z << "\n";
	return is;
}
main(void)
{
  Point d1(1,11,111), d2(2,22,222), d3(3,33,333);
  cout << d1<< d2 << d3  << endl ;
  return 0;
}
/*
1 , 11 , 111
2 , 22 , 222
3 , 33 , 333
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?