point.cs

来自「画图的作用 以及其他的类似图型转换的」· CS 代码 · 共 39 行

CS
39
字号
using System;

namespace chapter3
{
	/// <summary>
	/// Point 的摘要说明。
	/// </summary>
	public class Point
	{
		private int x,y;

		public Point(int x,int y)
		{
			this.x=x;
			this.y=y;
		}
		public static Point operator ++(Point p)
		{
			p.x++;
			p.y++;
			return p;
		}
		public void Display()
		{
			
			Console.WriteLine("Point.x={0},Point.y={1}",this.x,this.y);
		}
		public static Point operator + (Point p1,Point p2)
		{
			Point p= new Point(0,0);
			p.x=p1.x+p2.x;
			p.y=p1.y+p2.y;
			return p;
		}


	}
}

⌨️ 快捷键说明

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