using System;
class Point
{
\x05public int x,y;
\x05public Point()
\x05{
\x05\x05x = 0;
\x05\x05y = 0;
\x05}
\x05public Point(int x,int y)
\x05{
\x05\x05this.x=x;this.y=y;//
\x05}
\x05public override string ToString()
\x05{
\x05\x05return(String.Format("({0},{1})",x,y));
\x05}
}
class MainClass
{
\x05static void Main()
\x05{
\x05\x05Point p1 = new Point();
\x05\x05Point p2 = new Point(5,3);
\x05\x05Console.WriteLine("Point 1的坐标为{0}",p1);
\x05\x05Console.WriteLine("Point 2的坐标为{0}",p2);
\x05}
}
人气:257 ℃ 时间:2020-05-14 10:34:56
解答
using System;class Point//创建一个Point类{public int x, y;//声明xy两个工友字段public Point() //无参数构造函数{x = 0;//在无参数构造...
推荐
- 谁能详细地给我讲解一下这个程序
- 函数f(x)=a^x/(1+a^x) -a是奇函数 则实数a的值为?
- 若A>0,B>0,C
- 在三角形中,角A,B,C对边为a,b,c角A,B,C成等差数列.求cosB的值?若边a,b,c成等比求sinAsinC的值?
- 我应该对当前的生活比较满意.这样说可以吗?I should be satisfied with current life.请高手指点,谢谢
- 载流量与电流密度的关系…
- 权利与义务的关系(简洁点,用来答题的.
- How do you like the coat和How do you think of the coat有什么区别
猜你喜欢